Fix ErrorModal title
This commit is contained in:
@@ -17,7 +17,7 @@ const i18n = setupI18n('en', enMessages);
|
|||||||
const createProps = (overrideProps: Partial<PropsType> = {}): PropsType => ({
|
const createProps = (overrideProps: Partial<PropsType> = {}): PropsType => ({
|
||||||
buttonVariant: overrideProps.buttonVariant ?? undefined,
|
buttonVariant: overrideProps.buttonVariant ?? undefined,
|
||||||
description: overrideProps.description ?? '',
|
description: overrideProps.description ?? '',
|
||||||
title: overrideProps.title ?? '',
|
title: Object.hasOwn(overrideProps, 'title') ? overrideProps.title : '',
|
||||||
i18n,
|
i18n,
|
||||||
onClose: action('onClick'),
|
onClose: action('onClick'),
|
||||||
});
|
});
|
||||||
@@ -48,3 +48,14 @@ export function CustomStrings(): JSX.Element {
|
|||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function NoTitle(): JSX.Element {
|
||||||
|
return (
|
||||||
|
<ErrorModal
|
||||||
|
{...createProps({
|
||||||
|
title: null,
|
||||||
|
description: 'This is a fun error!',
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
@@ -40,7 +40,7 @@ export function ErrorModal(props: PropsType): JSX.Element {
|
|||||||
modalName="ErrorModal"
|
modalName="ErrorModal"
|
||||||
i18n={i18n}
|
i18n={i18n}
|
||||||
onClose={onClose}
|
onClose={onClose}
|
||||||
title={title == null ? undefined : i18n('icu:ErrorModal--title')}
|
title={title == null ? undefined : title || i18n('icu:ErrorModal--title')}
|
||||||
modalFooter={footer}
|
modalFooter={footer}
|
||||||
>
|
>
|
||||||
<div className="module-error-modal__description">
|
<div className="module-error-modal__description">
|
||||||
|
Reference in New Issue
Block a user