From fe3f6dba5615bb113dc950ec4520240b341cbf9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Susanna=20Landstr=C3=B6m?= Date: Fri, 22 Dec 2023 13:54:21 +0200 Subject: [PATCH 1/2] add speading sx props --- src/components/AlertBase.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/AlertBase.tsx b/src/components/AlertBase.tsx index 96deecd87..765e5d635 100644 --- a/src/components/AlertBase.tsx +++ b/src/components/AlertBase.tsx @@ -17,7 +17,7 @@ const AlertBase = ( ref={ref} severity={severity} variant={variant} - sx={{ alignItems: 'center', '& .MuiAlert-action': { pt: 0, pl: 5 } }} + sx={{ alignItems: 'center', '& .MuiAlert-action': { pt: 0, pl: 5 }, ...props.sx }} {...props} /> ); From 22466cbaca83f21bd584c944d2253315f27ccd85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Susanna=20Landstr=C3=B6m?= Date: Fri, 22 Dec 2023 13:57:29 +0200 Subject: [PATCH 2/2] destruct sx from props --- src/components/AlertBase.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/AlertBase.tsx b/src/components/AlertBase.tsx index 765e5d635..3fff7fd1b 100644 --- a/src/components/AlertBase.tsx +++ b/src/components/AlertBase.tsx @@ -9,7 +9,7 @@ export interface AlertBaseProps extends MuiAlertProps { } const AlertBase = ( - { severity = 'success', variant = 'standard', ...props }: AlertBaseProps, + { severity = 'success', variant = 'standard', sx, ...props }: AlertBaseProps, ref: Ref ): JSX.Element => { return ( @@ -17,7 +17,7 @@ const AlertBase = ( ref={ref} severity={severity} variant={variant} - sx={{ alignItems: 'center', '& .MuiAlert-action': { pt: 0, pl: 5 }, ...props.sx }} + sx={{ alignItems: 'center', '& .MuiAlert-action': { pt: 0, pl: 5 }, ...sx }} {...props} /> );