From 9fc42d95737975bf5dc1c3d657c69a4524fb4c7b Mon Sep 17 00:00:00 2001 From: lingdocs <71590811+lingdocs@users.noreply.github.com> Date: Sat, 9 Oct 2021 21:45:42 -0400 Subject: [PATCH] fix equative explorer --- scripts/get-words.js | 4 ++-- src/components/EquativeExplorer.tsx | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/scripts/get-words.js b/scripts/get-words.js index d04ee09..1a6af26 100644 --- a/scripts/get-words.js +++ b/scripts/get-words.js @@ -70,8 +70,8 @@ function getNounsAdjsFromTsS(entries) { console.log("couldn't find ts", item); return undefined; } - const firstWord = entry.e.split(",")[0].split(";")[0].split("(")[0].trim(); - console.log(firstWord, entry.f, entry.ts); + // const firstWord = entry.e.split(",")[0].split(";")[0].split("(")[0].trim(); + // console.log(firstWord, entry.f, entry.ts); // if (firstWord.contains(" ")) console.log("SPACE PRESENT"); return { entry, def: item.e, category: item.category }; }).filter(x => x); diff --git a/src/components/EquativeExplorer.tsx b/src/components/EquativeExplorer.tsx index be6b033..0bfad9c 100644 --- a/src/components/EquativeExplorer.tsx +++ b/src/components/EquativeExplorer.tsx @@ -42,8 +42,9 @@ function makeBlock(e: PredicateInput): T.VerbBlock { type PredicateType = "adjectives" | "unisexNouns"; function EquativeExplorer() { + // TODO: Use sticky state const predicateTypes: PredicateType[] = ["adjectives", "unisexNouns"]; - const [predicate, setPredicate] = useState(inputs.adjectives[0].ts); + const [predicate, setPredicate] = useState(1527815306); const [predicateType, setPredicateType] = useState("adjectives"); function handlePredicateSelect(e: React.ChangeEvent) { setPredicate(parseInt(e.target.value)); @@ -97,8 +98,8 @@ function EquativeExplorer() { value={predicate} onChange={handlePredicateSelect} > - {inputs[predicateType].map((adj: AdjectiveInput | UnisexNounInput) => ( - + {inputs[predicateType].map((e: AdjectiveInput | UnisexNounInput) => ( + ))}