From a97b85863e25b71750162cc35c6a44ba09a166ef Mon Sep 17 00:00:00 2001 From: lingdocs <71590811+lingdocs@users.noreply.github.com> Date: Thu, 21 Oct 2021 07:11:43 -0400 Subject: [PATCH] gender on nouns in selector --- .../equative-explorer/explorer-selectors.tsx | 52 ++++++++++--------- 1 file changed, 28 insertions(+), 24 deletions(-) diff --git a/src/components/equative-explorer/explorer-selectors.tsx b/src/components/equative-explorer/explorer-selectors.tsx index c93f625..6af6cfd 100644 --- a/src/components/equative-explorer/explorer-selectors.tsx +++ b/src/components/equative-explorer/explorer-selectors.tsx @@ -10,7 +10,7 @@ import { ButtonSelect, Types as T, } from "@lingdocs/pashto-inflector"; -import { isPluralEntry } from "../../lib/type-predicates"; +import { isFemNoun, isMascNoun, isPluralEntry } from "../../lib/type-predicates"; import Select from "react-select"; const zIndexProps = { @@ -111,29 +111,33 @@ export function SubjectSelector({ state, dispatch }: { placeholder={options.find(o => o.value === subject?.ts.toString())?.label} {...zIndexProps} /> -
- {state.subjectType !== "participle" &&
- dispatch({ type: "setSubjectPlural", payload: p === "plural" ? true : false })} - /> -
} - {state.subjectType === "unisexNoun" &&
- dispatch({ type: "setSubjectGender", payload: p as T.Gender })} - /> -
} +
+ {state.subjectType !== "participle" && <> +
+ null : (p) => dispatch({ type: "setSubjectGender", payload: p as T.Gender })} + /> +
+
+ dispatch({ type: "setSubjectPlural", payload: p === "plural" ? true : false })} + /> +
+ }
}