diff --git a/package.json b/package.json index 6606226..53046bc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@lingdocs/pashto-inflector", - "version": "1.3.9", + "version": "1.4.0", "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/ButtonSelect.tsx b/src/components/ButtonSelect.tsx index 0e078f2..36d01f2 100644 --- a/src/components/ButtonSelect.tsx +++ b/src/components/ButtonSelect.tsx @@ -9,7 +9,7 @@ import classNames from "classnames"; type PickerProps = { - options: { label: any, value: string }[], + options: { label: any, value: string, color?: string }[], value: string, handleChange: (payload: string) => void, small?: boolean, @@ -33,6 +33,8 @@ function ButtonSelect(props: PickerProps) { onClick={() => props.handleChange(option.value)} style={props.xSmall ? { fontSize: "small", + ...option.color ? + { background: option.color } : {}, } : {}} > {option.label} diff --git a/src/components/VerbTable.tsx b/src/components/VerbTable.tsx index 0469d93..c890d98 100644 --- a/src/components/VerbTable.tsx +++ b/src/components/VerbTable.tsx @@ -14,7 +14,7 @@ import { } from "../lib/p-text-helpers"; import { isSentenceForm } from "../lib/misc-helpers"; import * as T from "../types"; - +import genderColors from "../lib/gender-colors"; const genderAbbrev = (gender: "masc" | "fem" | undefined): " m." | " f." | "" => ( gender === "masc" @@ -87,10 +87,7 @@ function VerbTable({ block, textOptions, english }: { const rowLabel = `${pers[i]}${genderAbbrev(gender)}`; const color = !gender ? "inherit" - : gender === "masc" - ? "#78c8ed" - : "#ff99aa"; - + : genderColors[gender]; return (