onlyPhrases option on VPExplorer

This commit is contained in:
adueck 2023-02-16 20:16:42 +05:00
parent eebce37411
commit 715744e9b4
5 changed files with 9 additions and 8 deletions

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "pashto-inflector",
"version": "5.7.14",
"version": "5.7.15",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "pashto-inflector",
"version": "5.7.14",
"version": "5.7.15",
"hasInstallScript": true,
"license": "MIT",
"dependencies": {

View File

@ -1,6 +1,6 @@
{
"name": "pashto-inflector",
"version": "5.7.14",
"version": "5.7.15",
"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",

View File

@ -1,6 +1,6 @@
{
"name": "@lingdocs/ps-react",
"version": "5.7.14",
"version": "5.7.15",
"description": "Pashto inflector library module with React components",
"main": "dist/components/library.js",
"module": "dist/components/library.js",

View File

@ -33,6 +33,7 @@ function VPExplorer(props: {
opts: T.TextOptions,
handleLinkClick: ((ts: number) => void) | "none",
entryFeeder: T.EntryFeeder,
onlyPhrases?: boolean,
}) {
const [vps, adjustVps] = useStickyReducer(
vpsReducer,
@ -44,7 +45,7 @@ function VPExplorer(props: {
);
const [mode, setMode] = useStickyState<"charts" | "phrases" | "quiz">(
savedMode => {
if (!savedMode) return "charts";
if (!savedMode) return props.onlyPhrases ? "phrases" : "charts";
if (savedMode === "quiz") return "phrases";
return savedMode;
},
@ -127,7 +128,7 @@ function VPExplorer(props: {
opts={props.opts}
handleLinkClick={props.handleLinkClick}
/>
<div className="mt-2 mb-3 d-flex flex-row justify-content-between align-items-center">
{!props.onlyPhrases && <div className="mt-2 mb-3 d-flex flex-row justify-content-between align-items-center">
<div style={{ width: "1rem" }}>
</div>
<ButtonSelect
@ -155,7 +156,7 @@ function VPExplorer(props: {
{mode === "phrases" ? <i className="fas fa-share-alt" /> : ""}
</div>
</div>
</div>
</div>}
{(vps.verb && (typeof object === "object") && (vps.verb.isCompound !== "dynamic") && (vps.verb.tenseCategory !== "imperative") &&(mode === "phrases")) &&
<div className="text-center my-2">
<button onClick={handleSubjObjSwap} className="btn btn-sm btn-light">

View File

@ -1,6 +1,6 @@
{
"name": "@lingdocs/inflect",
"version": "5.7.14",
"version": "5.7.15",
"description": "Pashto inflector library",
"main": "dist/index.js",
"types": "dist/lib/library.d.ts",