fix equative explorer
This commit is contained in:
parent
285efdd026
commit
9fc42d9573
|
@ -70,8 +70,8 @@ function getNounsAdjsFromTsS(entries) {
|
||||||
console.log("couldn't find ts", item);
|
console.log("couldn't find ts", item);
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
const firstWord = entry.e.split(",")[0].split(";")[0].split("(")[0].trim();
|
// const firstWord = entry.e.split(",")[0].split(";")[0].split("(")[0].trim();
|
||||||
console.log(firstWord, entry.f, entry.ts);
|
// console.log(firstWord, entry.f, entry.ts);
|
||||||
// if (firstWord.contains(" ")) console.log("SPACE PRESENT");
|
// if (firstWord.contains(" ")) console.log("SPACE PRESENT");
|
||||||
return { entry, def: item.e, category: item.category };
|
return { entry, def: item.e, category: item.category };
|
||||||
}).filter(x => x);
|
}).filter(x => x);
|
||||||
|
|
|
@ -42,8 +42,9 @@ function makeBlock(e: PredicateInput): T.VerbBlock {
|
||||||
type PredicateType = "adjectives" | "unisexNouns";
|
type PredicateType = "adjectives" | "unisexNouns";
|
||||||
|
|
||||||
function EquativeExplorer() {
|
function EquativeExplorer() {
|
||||||
|
// TODO: Use sticky state
|
||||||
const predicateTypes: PredicateType[] = ["adjectives", "unisexNouns"];
|
const predicateTypes: PredicateType[] = ["adjectives", "unisexNouns"];
|
||||||
const [predicate, setPredicate] = useState<number>(inputs.adjectives[0].ts);
|
const [predicate, setPredicate] = useState<number>(1527815306);
|
||||||
const [predicateType, setPredicateType] = useState<PredicateType>("adjectives");
|
const [predicateType, setPredicateType] = useState<PredicateType>("adjectives");
|
||||||
function handlePredicateSelect(e: React.ChangeEvent<HTMLSelectElement>) {
|
function handlePredicateSelect(e: React.ChangeEvent<HTMLSelectElement>) {
|
||||||
setPredicate(parseInt(e.target.value));
|
setPredicate(parseInt(e.target.value));
|
||||||
|
@ -97,8 +98,8 @@ function EquativeExplorer() {
|
||||||
value={predicate}
|
value={predicate}
|
||||||
onChange={handlePredicateSelect}
|
onChange={handlePredicateSelect}
|
||||||
>
|
>
|
||||||
{inputs[predicateType].map((adj: AdjectiveInput | UnisexNounInput) => (
|
{inputs[predicateType].map((e: AdjectiveInput | UnisexNounInput) => (
|
||||||
<option key={adj.ts} value={adj.ts+"s"}>{adj.p} - {removeFVarients(adj.f)}</option>
|
<option key={e.ts+"s"} value={e.ts}>{e.p} - {removeFVarients(e.f)}</option>
|
||||||
))}
|
))}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue