From 2a16468f52ea83ce394ce2e5290137c1c4975d6d Mon Sep 17 00:00:00 2001 From: lingdocs <71590811+lingdocs@users.noreply.github.com> Date: Sun, 18 Jul 2021 12:15:21 +0300 Subject: [PATCH] bug fix with limiting conjugation viewer forms --- package.json | 2 +- src/App.tsx | 1 + src/components/ConjugationViewer.tsx | 35 +++++++++++---------------- src/components/verb-info/VerbInfo.tsx | 7 +++--- 4 files changed, 20 insertions(+), 25 deletions(-) diff --git a/package.json b/package.json index 5c9f112..3d2c84c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@lingdocs/pashto-inflector", - "version": "0.8.0", + "version": "0.8.1", "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/App.tsx b/src/App.tsx index 375e0ab..de04bee 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -301,6 +301,7 @@ function App() { entry={v?.verb.entry} complement={v?.verb.complement} textOptions={textOptions} + showOnly={["Perfective Future"]} />} diff --git a/src/components/ConjugationViewer.tsx b/src/components/ConjugationViewer.tsx index 37663f2..a6620a0 100644 --- a/src/components/ConjugationViewer.tsx +++ b/src/components/ConjugationViewer.tsx @@ -7,7 +7,7 @@ */ import { useEffect, useReducer } from "react"; -import VerbInfo, { RootsAndStems } from "./verb-info/VerbInfo"; +import VerbInfo from "./verb-info/VerbInfo"; import VerbFormDisplay from "./VerbFormDisplay"; import ButtonSelect from "./ButtonSelect"; import Hider from "./Hider"; @@ -224,7 +224,7 @@ function ConjugationViewer({ entry, complement, textOptions, showOnly, highlight } : undefined; const filterDifficulty = (f: T.DisplayForm): boolean => ( - state.difficulty === "advanced" || !f.advanced + state.difficulty === "advanced" || !!showOnly || !f.advanced ); const limitTo = !showOnly ? undefined @@ -235,7 +235,8 @@ function ConjugationViewer({ entry, complement, textOptions, showOnly, highlight conj: verbConj, filterFunc: [ filterDifficulty, - ...limitTo ? [(f: T.DisplayForm): boolean => limitTo.includes(f.label)] : [], + ...limitTo ? [(f: T.DisplayForm): boolean => limitTo.includes(f.label) + ] : [], ], mode: state.mode, subject: state.subject, @@ -293,24 +294,16 @@ function ConjugationViewer({ entry, complement, textOptions, showOnly, highlight handleChange={(p) => dispatch({ type: "set compound complement version", payload: p as "sing" | "plur" })} /> - } - {!limitTo ? - dispatch({ type: "toggle showingStemsAndRoots" })} - hidePastParticiple={hidePastParticiple} - /> - : - - } + } + dispatch({ type: "toggle showingStemsAndRoots" })} + hidePastParticiple={hidePastParticiple} + hideTypeInfo={!!limitTo} + />
void, hidePastParticiple?: boolean, + hideTypeInfo?: boolean, }) { const inf = noPersInfs(info.root.imperfective).long; return (
- + />}