ui touchup
This commit is contained in:
parent
7655bcd6f3
commit
17f4ff1b41
|
@ -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>
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue