From 1e4d5b561811e34a9630d515c8bee83882bdc357 Mon Sep 17 00:00:00 2001
From: lingdocs <71590811+lingdocs@users.noreply.github.com>
Date: Wed, 3 Nov 2021 17:57:13 -0400
Subject: [PATCH] p
---
package.json | 2 +-
src/App.tsx | 10 ++++------
src/components/ButtonSelect.tsx | 10 +++++-----
src/components/ConjugationViewer.tsx | 8 ++++----
4 files changed, 14 insertions(+), 16 deletions(-)
diff --git a/package.json b/package.json
index 53046bc..d8eab55 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "@lingdocs/pashto-inflector",
- "version": "1.4.0",
+ "version": "1.4.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 3248ee2..08ad122 100644
--- a/src/App.tsx
+++ b/src/App.tsx
@@ -263,9 +263,7 @@ function App() {
{ label: "irregular", value: "irregular" },
]}
value={regularIrregular}
- handleChange={(p) => {
- setRegularIrregular(p as "regular" | "irregular");
- }}
+ handleChange={setRegularIrregular}
/>
}
@@ -313,7 +311,7 @@ function App() {
handleChange={(p) => {
setTextOptions({
...textOptions,
- spelling: p as T.Spelling,
+ spelling: p,
});
}}
/>
@@ -334,7 +332,7 @@ function App() {
{ label: "X-Large", value: "largest" },
]}
value={textOptions.pTextSize}
- handleChange={(p) => setTextOptions({ ...textOptions, pTextSize: p as "normal" | "larger" | "largest" })}
+ handleChange={(p) => setTextOptions({ ...textOptions, pTextSize: p })}
/>
Phonetics
setTextOptions({ ...textOptions, phonetics: p as "lingdocs" | "ipa" | "none" | "alalc" })}
+ handleChange={(p) => setTextOptions({ ...textOptions, phonetics: p })}
/>
diff --git a/src/components/ButtonSelect.tsx b/src/components/ButtonSelect.tsx
index 36d01f2..95a2c38 100644
--- a/src/components/ButtonSelect.tsx
+++ b/src/components/ButtonSelect.tsx
@@ -8,15 +8,15 @@
import classNames from "classnames";
-type PickerProps = {
- options: { label: any, value: string, color?: string }[],
- value: string,
- handleChange: (payload: string) => void,
+type PickerProps = {
+ options: { label: any, value: T, color?: string }[],
+ value: T,
+ handleChange: (payload: T) => void,
small?: boolean,
xSmall?: boolean,
}
-function ButtonSelect(props: PickerProps) {
+function ButtonSelect(props: PickerProps) {
return (
diff --git a/src/components/ConjugationViewer.tsx b/src/components/ConjugationViewer.tsx
index 658c6c3..503d18b 100644
--- a/src/components/ConjugationViewer.tsx
+++ b/src/components/ConjugationViewer.tsx
@@ -248,7 +248,7 @@ function ConjugationViewer({ entry, complement, textOptions, showOnly, highlight
},
]}
value={state.transitivitySelected}
- handleChange={(p) => dispatch({ type: "setTransitivitySelected", payload: p as "transitive" | "grammatically transitive" })}
+ handleChange={(p) => dispatch({ type: "setTransitivitySelected", payload: p })}
/>
}
@@ -264,7 +264,7 @@ function ConjugationViewer({ entry, complement, textOptions, showOnly, highlight
},
]}
value={state.compoundTypeSelected}
- handleChange={(p) => dispatch({ type: "choose compound type", payload: p as "dynamic" | "stative" })}
+ handleChange={(p) => dispatch({ type: "choose compound type", payload: p })}
/>
}
@@ -280,7 +280,7 @@ function ConjugationViewer({ entry, complement, textOptions, showOnly, highlight
{ label: `Plur. ${verbConj1.info.objComplement.plural.p}`, value: "plur" },
]}
value={state.compoundComplementVersionSelected}
- handleChange={(p) => dispatch({ type: "set compound complement version", payload: p as "sing" | "plur" })}
+ handleChange={(p) => dispatch({ type: "set compound complement version", payload: p })}
/>
}
@@ -301,7 +301,7 @@ function ConjugationViewer({ entry, complement, textOptions, showOnly, highlight
{ label: `Sentences`, value: "sentence" },
]}
value={state.mode}
- handleChange={(p) => dispatch({ type: "setMode", payload: p as "chart" | "sentence" })}
+ handleChange={(p) => dispatch({ type: "setMode", payload: p })}
/>
}
{!limitTo && <>