ui touchup

This commit is contained in:
lingdocs 2022-04-09 18:02:36 +05:00
parent 7655bcd6f3
commit 17f4ff1b41
3 changed files with 7 additions and 7 deletions

View File

@ -19,6 +19,8 @@ function EntrySelect<E extends T.DictionaryEntry | T.VerbEntry>(props: ({
isVerbSelect?: boolean,
opts: T.TextOptions,
}) {
const placeholder = "entries" in props ? "Select…" : "Search Pashto";
const minWidth = "9rem";
function makeOption(e: E | T.DictionaryEntry) {
if ("entry" in e) {
return (props.isVerbSelect ? makeVerbSelectOption : makeSelectOption)(e, props.opts);
@ -40,7 +42,7 @@ function EntrySelect<E extends T.DictionaryEntry | T.VerbEntry>(props: ({
if (!s) return;
props.onChange(s);
}
return <div>
return <div style={{ minWidth }}>
<AsyncSelect
isSearchable={true}
className="mb-2"
@ -48,7 +50,7 @@ function EntrySelect<E extends T.DictionaryEntry | T.VerbEntry>(props: ({
onChange={onChange}
defaultOptions={[]}
loadOptions={options}
placeholder={props.name ? `Select ${props.name}...` : undefined}
placeholder={placeholder}
{...zIndexProps}
/>
</div>;
@ -74,14 +76,14 @@ function EntrySelect<E extends T.DictionaryEntry | T.VerbEntry>(props: ({
if (!s) return;
props.onChange(s);
}
return <div>
return <div style={{ minWidth }}>
<Select
isSearchable={true}
value={value}
onChange={onChange}
className="mb-2"
options={options}
placeholder={props.name ? `Select ${props.name}...` : undefined}
placeholder={placeholder}
{...zIndexProps}
/>
</div>

View File

@ -79,8 +79,6 @@ export function getEnglishVerb(entry: T.DictionaryEntry): string {
export function getEnglishParticiple(entry: T.DictionaryEntry): string {
if (!entry.ec) {
console.log("errored participle");
console.log(entry);
throw new Error("no english information for participle");
}
const ec = parseEc(entry.ec);

View File

@ -9,7 +9,7 @@ export function isNounEntry(e: T.Entry | T.DictionaryEntry): e is T.NounEntry {
return !!(e.c && (e.c.includes("n. m.") || e.c.includes("n. f.")));
}
export function isAdjectiveEntry(e: T.Entry): e is T.AdjectiveEntry {
export function isAdjectiveEntry(e: T.Entry | T.DictionaryEntry): e is T.AdjectiveEntry {
if ("entry" in e) return false;
return !!e.c?.includes("adj.") && !isNounEntry(e);
}