diff --git a/packages/frontend/src/components/shared/Toast/SimpleToast.tsx b/packages/frontend/src/components/shared/Toast/SimpleToast.tsx index d780640f..c15f2d45 100644 --- a/packages/frontend/src/components/shared/Toast/SimpleToast.tsx +++ b/packages/frontend/src/components/shared/Toast/SimpleToast.tsx @@ -17,13 +17,15 @@ interface CtaProps extends ButtonBaseProps, ButtonTheme { buttonLabel: string; } export interface SimpleToastProps extends ToastProps { + id: string; title: string; variant?: SimpleToastTheme['variant']; cta?: CtaProps[]; - onDismiss: (id?: string) => void; + onDismiss: (toastId: string) => void; } export const SimpleToast = ({ + id, className, title, variant = 'success', @@ -50,23 +52,23 @@ export const SimpleToast = ({ const renderCta = useMemo(() => { if (!hasCta) return null; return ( -
- {cta.map(({ buttonLabel, ...props }, index) => ( - - ))} -
- ); +
+ {cta.map(({ buttonLabel, ...props }, index) => ( + + ))} +
+ ); }, [cta]); const renderCloseButton = useMemo( () => ( -
onDismiss(props.id)} className={closeIconCls()}> +
onDismiss(id)} className={closeIconCls()}>
), - [], + [id], ); return ( diff --git a/packages/frontend/src/components/shared/Toast/Toaster.tsx b/packages/frontend/src/components/shared/Toast/Toaster.tsx index 85222167..66556956 100644 --- a/packages/frontend/src/components/shared/Toast/Toaster.tsx +++ b/packages/frontend/src/components/shared/Toast/Toaster.tsx @@ -11,7 +11,7 @@ export const Toaster = ({}: ToasterProps) => { const renderToasts = useMemo( () => toasts.map(({ id, ...props }) => ( - + )), [toasts], );