oops
This commit is contained in:
parent
f1dd160b53
commit
0467080343
|
@ -181,6 +181,7 @@ function VerbPicker({ onChange, subject, changeSubject, verb, verbs }: {
|
||||||
value={verb?.verb}
|
value={verb?.verb}
|
||||||
onChange={onVerbSelect}
|
onChange={onVerbSelect}
|
||||||
name="Verb"
|
name="Verb"
|
||||||
|
isVerbSelect
|
||||||
/>
|
/>
|
||||||
{/* <Select
|
{/* <Select
|
||||||
value={verb && verb.verb.entry.ts.toString()}
|
value={verb && verb.verb.entry.ts.toString()}
|
||||||
|
|
|
@ -43,7 +43,11 @@ function NPPicker({ np, onChange, counterPart, asObject }: {
|
||||||
const isDynamicComplement = np && np.type === "noun" && np.dynamicComplement;
|
const isDynamicComplement = np && np.type === "noun" && np.dynamicComplement;
|
||||||
const clearButton = <button className="btn btn-sm btn-light mb-2" onClick={handleClear}>X</button>;
|
const clearButton = <button className="btn btn-sm btn-light mb-2" onClick={handleClear}>X</button>;
|
||||||
return <div>
|
return <div>
|
||||||
{!npType && <div className="text-center mt-3">
|
{!npType && <div className="d-flex flex-row align-items-center text-center mt-3">
|
||||||
|
<div className="h4 mr-3">
|
||||||
|
NP
|
||||||
|
</div>
|
||||||
|
<div className="ml-3">
|
||||||
{npTypes.map((npt) => <div className="mb-2">
|
{npTypes.map((npt) => <div className="mb-2">
|
||||||
<button
|
<button
|
||||||
key={npt}
|
key={npt}
|
||||||
|
@ -54,6 +58,7 @@ function NPPicker({ np, onChange, counterPart, asObject }: {
|
||||||
{npt}
|
{npt}
|
||||||
</button>
|
</button>
|
||||||
</div>)}
|
</div>)}
|
||||||
|
</div>
|
||||||
</div>}
|
</div>}
|
||||||
{(npType === "pronoun" && np?.type === "pronoun")
|
{(npType === "pronoun" && np?.type === "pronoun")
|
||||||
? <PronounPicker
|
? <PronounPicker
|
||||||
|
|
|
@ -1,21 +0,0 @@
|
||||||
import NPPicker from "../np-picker/NPPicker";
|
|
||||||
|
|
||||||
function ObjectDisplay({ object, onChange, counterPart }: {
|
|
||||||
object: Exclude<VerbObject, "none">,
|
|
||||||
onChange: (o: NPSelection | undefined) => void,
|
|
||||||
counterPart: NPSelection | undefined ,
|
|
||||||
}) {
|
|
||||||
return <div>
|
|
||||||
{(typeof object === "number")
|
|
||||||
? <div className="text-muted">Unspoken 3rd Pers. Masc. Plur.</div>
|
|
||||||
: <NPPicker
|
|
||||||
asObject
|
|
||||||
np={object}
|
|
||||||
counterPart={counterPart}
|
|
||||||
onChange={onChange}
|
|
||||||
/>}
|
|
||||||
</div>;
|
|
||||||
}
|
|
||||||
|
|
||||||
export default ObjectDisplay;
|
|
||||||
|
|
|
@ -2,7 +2,6 @@ import { useState } from "react";
|
||||||
import NPPicker from "../np-picker/NPPicker";
|
import NPPicker from "../np-picker/NPPicker";
|
||||||
import VerbPicker from "../VerbPicker";
|
import VerbPicker from "../VerbPicker";
|
||||||
import VPDisplay from "./VPDisplay";
|
import VPDisplay from "./VPDisplay";
|
||||||
import ObjectDisplay from "./ObjectDisplay";
|
|
||||||
import { verbs } from "../../words/words";
|
import { verbs } from "../../words/words";
|
||||||
import { renderVP } from "../../lib/phrase-building";
|
import { renderVP } from "../../lib/phrase-building";
|
||||||
import {
|
import {
|
||||||
|
@ -66,11 +65,14 @@ export function PhraseBuilder() {
|
||||||
</div>
|
</div>
|
||||||
{verb && (verb.object !== "none") && <div className="my-2">
|
{verb && (verb.object !== "none") && <div className="my-2">
|
||||||
<div className="h4">Object {showRole(VPRendered, "object")}</div>
|
<div className="h4">Object {showRole(VPRendered, "object")}</div>
|
||||||
<ObjectDisplay
|
{(typeof verb.object === "number")
|
||||||
object={verb.object}
|
? <div className="text-muted">Unspoken 3rd Pers. Masc. Plur.</div>
|
||||||
|
: <NPPicker
|
||||||
|
asObject
|
||||||
|
np={verb.object}
|
||||||
counterPart={subject}
|
counterPart={subject}
|
||||||
onChange={handleObjectChange}
|
onChange={handleObjectChange}
|
||||||
/>
|
/>}
|
||||||
</div>}
|
</div>}
|
||||||
<div className="my-2">
|
<div className="my-2">
|
||||||
<div className="h4">Verb</div>
|
<div className="h4">Verb</div>
|
||||||
|
|
Loading…
Reference in New Issue