From 735bb8d6fd51166c3b9ce7904c41c38ce107113e Mon Sep 17 00:00:00 2001 From: lingdocs <71590811+lingdocs@users.noreply.github.com> Date: Wed, 27 Jul 2022 00:00:44 -0500 Subject: [PATCH] ability to explode words --- website/package.json | 1 + website/src/screens/IsolatedEntry.tsx | 94 +++++++++++++++++---------- 2 files changed, 60 insertions(+), 35 deletions(-) diff --git a/website/package.json b/website/package.json index 8301ead..785fcc5 100644 --- a/website/package.json +++ b/website/package.json @@ -3,6 +3,7 @@ "version": "0.1.0", "license": "MIT", "author": "lingdocs.com", + "homepage": "https://dictionary.lingdocs.com", "private": true, "dependencies": { "@fortawesome/fontawesome-free": "^5.15.2", diff --git a/website/src/screens/IsolatedEntry.tsx b/website/src/screens/IsolatedEntry.tsx index 739033d..9a6e502 100644 --- a/website/src/screens/IsolatedEntry.tsx +++ b/website/src/screens/IsolatedEntry.tsx @@ -46,6 +46,7 @@ function IsolatedEntry({ state, dictionary, isolateEntry }: { dictionary: DictionaryAPI, isolateEntry: (ts: number) => void, }) { + const [exploded, setExploded] = useState(false); const [editing, setEditing] = useState(false); const [comment, setComment] = useState(""); const [editSubmitted, setEditSubmitted] = useState(false); @@ -103,6 +104,27 @@ function IsolatedEntry({ state, dictionary, isolateEntry }: { return false; } })(); + function DisplayVPExplorer(props: { + entry: T.DictionaryEntry, + complement: T.DictionaryEntry | undefined, + }) { + try { + return + } catch (e) { + console.error("error rendering VPExplorer", e); + return null; + } + } return
{entry.p} - LingDocs Pashto Dictionary @@ -111,37 +133,42 @@ function IsolatedEntry({ state, dictionary, isolateEntry }: {
- {state.user && -
-
- {state.user.level === "editor" && <> -
navigator.clipboard.writeText(entry.ts.toString())}> - +
+
+
setExploded(os => !os)} + > + +
+ {state.user && <> + (state.user.level === "editor" && <> +
navigator.clipboard.writeText(entry.ts.toString())}> + +
+
navigator.clipboard.writeText(JSON.stringify(entry))}> + +
+ +
+
-
navigator.clipboard.writeText(JSON.stringify(entry))}> - -
- -
- -
- - - } + + )
setEditing(!editing)} + onClick={() => setEditing(os => !os)} > - +
{wordlistEnabled(state.user) &&
} -
+ }
- } +
{wordlistWord && <> {hasAttachment(wordlistWord, "audio") && } @@ -207,17 +234,7 @@ function IsolatedEntry({ state, dictionary, isolateEntry }: {
} } {tp.isVerbEntry({ entry, complement }) &&
- +
} {relatedEntries && <> @@ -257,4 +274,11 @@ function IsolatedEntry({ state, dictionary, isolateEntry }: {
; } +function explodeEntry(entry: T.DictionaryEntry): T.DictionaryEntry { + return { + ...entry, + p: entry.p.split("").join(" "), + }; +} + export default IsolatedEntry; \ No newline at end of file