fixed
This commit is contained in:
parent
d0850066a2
commit
977f37da71
|
@ -23,7 +23,14 @@ function VerbPicker({ onChange, subject, changeSubject, verb, verbs, opts, verbL
|
||||||
verbLocked: boolean,
|
verbLocked: boolean,
|
||||||
}) {
|
}) {
|
||||||
const [showRootsAndStems, setShowRootsAndStems] = useStickyState<boolean>(false, "showRootsAndStems");
|
const [showRootsAndStems, setShowRootsAndStems] = useStickyState<boolean>(false, "showRootsAndStems");
|
||||||
const info = verb ? getVerbInfo(verb.verb.entry, verb.verb.complement) : undefined;
|
const infoRaw = verb ? getVerbInfo(verb.verb.entry, verb.verb.complement) : undefined;
|
||||||
|
const info = (!infoRaw || !verb)
|
||||||
|
? undefined
|
||||||
|
: ("stative" in infoRaw)
|
||||||
|
? infoRaw[verb.isCompound === "stative" ? "stative" : "dynamic"]
|
||||||
|
: ("transitive" in infoRaw)
|
||||||
|
? infoRaw[verb.transitivity === "grammatically transitive" ? "grammaticallyTransitive" : "transitive"]
|
||||||
|
: infoRaw;
|
||||||
if (info && ("stative" in info || "transitive" in info)) {
|
if (info && ("stative" in info || "transitive" in info)) {
|
||||||
return <div>ERROR: Verb version should be select first</div>;
|
return <div>ERROR: Verb version should be select first</div>;
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,13 +8,15 @@ import {
|
||||||
} from "../../lib/phrase-building/vp-tools";
|
} from "../../lib/phrase-building/vp-tools";
|
||||||
|
|
||||||
function ChartDisplay({ VS, opts }: { VS: VerbSelection, opts: T.TextOptions }) {
|
function ChartDisplay({ VS, opts }: { VS: VerbSelection, opts: T.TextOptions }) {
|
||||||
const conjugations = conjugateVerb(VS.verb.entry, VS.verb.complement);
|
const rawConjugations = conjugateVerb(VS.verb.entry, VS.verb.complement);
|
||||||
if (!conjugations) {
|
if (!rawConjugations) {
|
||||||
return <div>Error conjugating verb</div>;
|
return <div>Error conjugating verb</div>;
|
||||||
}
|
}
|
||||||
if ("stative" in conjugations || "transitive" in conjugations) {
|
const conjugations = ("stative" in rawConjugations)
|
||||||
return <div>Error: compound or transitivity type should be selected first</div>;
|
? rawConjugations[VS.isCompound === "stative" ? "stative" : "dynamic"]
|
||||||
}
|
: ("transitive" in rawConjugations)
|
||||||
|
? rawConjugations[VS.transitivity === "grammatically transitive" ? "grammaticallyTransitive" : "transitive"]
|
||||||
|
: rawConjugations;
|
||||||
const form = getTenseVerbForm(conjugations, VS.tense, VS.tenseCategory, VS.voice);
|
const form = getTenseVerbForm(conjugations, VS.tense, VS.tenseCategory, VS.voice);
|
||||||
return <div className="mb-4">
|
return <div className="mb-4">
|
||||||
<VerbFormDisplay
|
<VerbFormDisplay
|
||||||
|
|
Loading…
Reference in New Issue