Skip to content

Commit

Permalink
Always add close button to snackbars
Browse files Browse the repository at this point in the history
  • Loading branch information
schroda committed Jan 2, 2025
1 parent ed99204 commit af8ada9
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/modules/core/components/snackbar/SnackbarWithDescription.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/

import { CustomContentProps, SnackbarContent, VariantType } from 'notistack';
import { closeSnackbar, CustomContentProps, SnackbarContent, VariantType } from 'notistack';
import { ForwardedRef, forwardRef, Fragment, memo } from 'react';
import Alert from '@mui/material/Alert';
import AlertTitle from '@mui/material/AlertTitle';
Expand Down Expand Up @@ -55,7 +55,13 @@ export const SnackbarWithDescription = memo(

return (
<SnackbarContent ref={ref}>
<Alert elevation={1} severity={severity} action={finalAction}>
<Alert
elevation={1}
severity={severity}
action={finalAction}
sx={{ minWidth: '100%' }}
onClose={() => closeSnackbar(id)}
>
<TitleComponent>{message}</TitleComponent>
{actualDescription}
{isDescriptionTooLong ? (
Expand Down

0 comments on commit af8ada9

Please sign in to comment.