From acd7b7b5046a4ec626f1665ff737950a72a2f0df Mon Sep 17 00:00:00 2001 From: lingdocs <71590811+lingdocs@users.noreply.github.com> Date: Wed, 22 Jun 2022 13:00:46 -0500 Subject: [PATCH] fix but with AP english not getting rendered --- package.json | 2 +- src/components/vp-explorer/VPDisplay.tsx | 3 ++- src/lib/phrase-building/render-sandwich.ts | 17 ++++++++++------- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index e6ff708..7f6c4bb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@lingdocs/pashto-inflector", - "version": "3.0.4", + "version": "3.0.5", "author": "lingdocs.com", "description": "A Pashto inflection and verb conjugation engine, inculding React components for displaying Pashto text, inflections, and conjugations", "homepage": "https://verbs.lingdocs.com", diff --git a/src/components/vp-explorer/VPDisplay.tsx b/src/components/vp-explorer/VPDisplay.tsx index b37a694..5a34e77 100644 --- a/src/components/vp-explorer/VPDisplay.tsx +++ b/src/components/vp-explorer/VPDisplay.tsx @@ -8,6 +8,7 @@ import ModeSelect, { Mode, ScriptSelect } from "../DisplayModeSelect"; import { useState } from "react"; import CompiledPTextDisplay from "../CompiledPTextDisplay"; import RenderedBlocksDisplay from "../RenderedBlocksDisplay"; +import useStickyState from "../../lib/useStickyState"; function VPDisplay({ VPS, opts, setForm, justify, onlyOne }: { VPS: T.VPSelectionState, @@ -17,7 +18,7 @@ function VPDisplay({ VPS, opts, setForm, justify, onlyOne }: { onlyOne?: boolean, }) { const [mode, setMode] = useState("text"); - const [script, setScript] = useState<"p" | "f">("f"); + const [script, setScript] = useStickyState<"p" | "f">("f", "blockScriptChoice"); const VP = completeVPSelection(VPS); if (!VP) { return
diff --git a/src/lib/phrase-building/render-sandwich.ts b/src/lib/phrase-building/render-sandwich.ts index 9e65b28..c2f2703 100644 --- a/src/lib/phrase-building/render-sandwich.ts +++ b/src/lib/phrase-building/render-sandwich.ts @@ -8,15 +8,18 @@ export function renderSandwich(s: T.SandwichSelection): T.Rendered