Compare commits

..

No commits in common. "cc8920ef2562163a8fea348ab2b150c5d43c36c5" and "8c82698593dc4e78de0ee7797914373f3da8ace1" have entirely different histories.

2 changed files with 11 additions and 25 deletions

View File

@ -95,7 +95,7 @@ const Results = (props: ResultsProps) => {
const num = props.searchResults.length; const num = props.searchResults.length;
const renderedName = renderConlang(conlang); const renderedName = renderConlang(conlang);
const searchType = (props.direction === SearchDirection.ToConlang) ? `English ${renderedName}` : `${renderedName} English`; const searchType = (props.direction === SearchDirection.ToConlang) ? `English -> ${renderedName}` : `${renderedName} -> English`;
const result = num === 1 ? "result" : "results"; const result = num === 1 ? "result" : "results";
const header = ( const header = (
<div className="searchResultHeader" key="header"> <div className="searchResultHeader" key="header">
@ -143,22 +143,15 @@ const App = (_props) => {
}; };
const handleSearch = (direction: SearchDirection) => { const handleSearch = (direction: SearchDirection) => {
// First convert any shorthand notation const searchTerm = direction === SearchDirection.ToEnglish ? convertSearchBoxShorthand(searchBoxInput, conlang) : searchBoxInput;
let processedSearchTerm = direction === SearchDirection.ToEnglish ? if (searchTerm === "") {
convertSearchBoxShorthand(searchBoxInput, conlang) :
searchBoxInput;
// Then normalize to lowercase
processedSearchTerm = processedSearchTerm.toLowerCase();
if (processedSearchTerm === "") {
setSearchResults(null); setSearchResults(null);
setSearchTerm(null); setSearchTerm(null);
setDirection(null); setDirection(null);
} else { } else {
searchEntry(processedSearchTerm, conlang, direction, (json) => { searchEntry(searchTerm, conlang, direction, (json) => {
setSearchResults(json); setSearchResults(json);
setSearchTerm(processedSearchTerm); setSearchTerm(searchTerm);
setDirection(direction); setDirection(direction);
}); });
} }
@ -212,7 +205,7 @@ const App = (_props) => {
onChange={ (evt) => { onChange={ (evt) => {
setSearchBoxInput(evt.target.value); setSearchBoxInput(evt.target.value);
}} }}
placeholder="Enter search term (case-insensitive)" placeholder="Enter search term"
/> />
</div> </div>
<div className="searchControls"> <div className="searchControls">

View File

@ -88,18 +88,11 @@ const SaiEntry = (props: {entry: SaiEntryProps}) => {
if (isNominal) { if (isNominal) {
const decl = declineSaimiar(entry); const decl = declineSaimiar(entry);
if (decl) { if (decl) {
morphology = ( morphology = (<span className="saimiarNounMorpho">
<table className="saimiarNounMorpho"> Abs: <i>{decl.abs}</i>, Erg: <i>{decl.erg}</i>, Adp: <i>{decl.adp}</i>,
<tr> All: <i>{decl.all}</i>, Loc: <i>{decl.loc}</i>, Ell: <i>{decl.ell}</i>,
<td>Abs: <i>{decl.abs}</i></td><td>Erg: <i>{decl.erg}</i></td><td>Adp: <i>{decl.adp}</i></td> Inst: <i>{decl.inst}</i>, Rel: <i>{decl.rel}</i>
</tr> </span>);
<tr>
<td>All: <i>{decl.all}</i></td><td>Loc: <i>{decl.loc}</i></td><td>Ell: <i>{decl.ell}</i></td>
</tr>
<tr>
<td>Inst: <i>{decl.inst}</i></td><td>Rel: <i>{decl.rel}</i></td><td></td>
</tr>
</table>);
} }
} }