diff --git a/components/Forms/Warning.tsx b/components/Forms/Warning.tsx new file mode 100644 index 000000000..30c8e9022 --- /dev/null +++ b/components/Forms/Warning.tsx @@ -0,0 +1,40 @@ +interface WarningAlertProps { + id: string + heading: string + body: Body + asHtml?: boolean +} +type Body = string | React.ReactElement | React.ReactElement[] + +export const WarningAlert: React.FC = ({ + id, + heading, + body, + asHtml, +}) => { + return ( +
+ {asHtml ? ( +

+ ) : ( +

+ {heading} +

+ )} + + {asHtml && typeof body === 'string' ? ( +
+ ) : ( +
{body}
+ )} +
+ ) +} + +export default WarningAlert diff --git a/components/Layout/index.tsx b/components/Layout/index.tsx index a192bc459..a0e082b42 100644 --- a/components/Layout/index.tsx +++ b/components/Layout/index.tsx @@ -147,7 +147,11 @@ export const Layout: React.VFC<{ logoAltText: tsln.logoAltText, }} /> - + {router.pathname !== '/questions' && ( +

+ {title} +

+ )}
void @@ -299,12 +300,9 @@ const StepperPage: React.FC = ({ setPageTitle }) => { formError={formError} /> {field.error && alertError && ( -
- + = ({ setPageTitle }) => { formError={formError} /> {field.error && alertError && ( -
- +