From 97364b284f0e85d7f1040fde9601f21a57aedde2 Mon Sep 17 00:00:00 2001 From: lingdocs <71590811+lingdocs@users.noreply.github.com> Date: Mon, 9 May 2022 17:23:55 -0500 Subject: [PATCH] better examples --- package.json | 2 +- src/components/Examples.tsx | 23 +++++++++++------------ src/lib/jsx-map.tsx | 2 +- src/lib/phrase-building/render-ep.ts | 1 + 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/package.json b/package.json index b2ad3fa..27efa78 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@lingdocs/pashto-inflector", - "version": "2.5.0", + "version": "2.5.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/components/Examples.tsx b/src/components/Examples.tsx index a2c8964..8faa5f0 100644 --- a/src/components/Examples.tsx +++ b/src/components/Examples.tsx @@ -23,25 +23,22 @@ function EnglishContent({ children }: { children: (string | JSX.Element)[] | (st ; } -function Examples({ - children, - ex, - opts, - lineHeight, -}: { - ex?: PsStringWSub | PsStringWSub[] | T.PsJSX | T.PsJSX[], - children: PsStringWSub | PsStringWSub[], +function Examples(props: ({ + ex: T.PsJSX | T.PsJSX[] | PsStringWSub | PsStringWSub[], +} | { + children: T.PsJSX | T.PsJSX[] | PsStringWSub | PsStringWSub[], +}) & { opts: T.TextOptions, lineHeight?: 0 | 1 | 2 | 3 | 4, }) { - const examples = children || ex; + const examples = "children" in props ? props.children : props.ex; const Example = ({ children: text }: { children: PsStringWSub }) => ( -