From 9f79dc0cc1673b7e5476e609b819a8c2065748de Mon Sep 17 00:00:00 2001 From: Shawn Date: Wed, 10 May 2023 14:45:01 -0400 Subject: [PATCH] feat: language support for help icon and modal --- src/components/HelpIcon/HelpIcon.stories.tsx | 17 +++++++++++++---- src/components/HelpIcon/HelpIcon.tsx | 10 +++++++--- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/src/components/HelpIcon/HelpIcon.stories.tsx b/src/components/HelpIcon/HelpIcon.stories.tsx index 4fac12a5..f64ce6d5 100644 --- a/src/components/HelpIcon/HelpIcon.stories.tsx +++ b/src/components/HelpIcon/HelpIcon.stories.tsx @@ -9,14 +9,23 @@ export default { const Template: Story = (args) => ; export const Default = Template.bind({}); -export const SampleAlpha = Template.bind({}); +export const SampleEN = Template.bind({}); +export const SampleFR = Template.bind({}); Default.args = { + lang: "en", title: "Descriptive title / Term requiring explanation", body: "Description", }; -SampleAlpha.args = { - title: "Alpha", - body: `Alpha means building a "proof of concept" tool or service to meet user needs and testing it with users.`, +SampleEN.args = { + lang: "en", + title: "Separated", + body: "You are separated when you start living separate and apart from your spouse or common law partner because of a breakdown in the relationship for a period of at least 90 days.

Refer to marital status for more information", +}; + +SampleFR.args = { + lang: "fr", + title: "Séparé", + body: "Vous êtes considéré séparé lorsque vous vivez séparément de votre époux ou conjoint en raison de la rupture de votre union pour une période de 90 jours ou plus.

Voir état civil pour plus d’information", }; diff --git a/src/components/HelpIcon/HelpIcon.tsx b/src/components/HelpIcon/HelpIcon.tsx index 4b217140..c29921ff 100644 --- a/src/components/HelpIcon/HelpIcon.tsx +++ b/src/components/HelpIcon/HelpIcon.tsx @@ -6,9 +6,10 @@ import { Button } from "../Button/Button"; export interface HelpIconProps { title: string; body: string; + lang: string; } -export const HelpIcon: React.FC = ({ title, body }) => { +export const HelpIcon: React.FC = ({ title, body, lang }) => { const [showModal, setShowModal] = useState(false); const handleClose = () => setShowModal(false); const handleShow = () => setShowModal(true); @@ -52,13 +53,16 @@ export const HelpIcon: React.FC = ({ title, body }) => { -

{body}

+