Always add close button to snackbars
This commit is contained in:
@@ -6,7 +6,7 @@
|
|||||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
* 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 { ForwardedRef, forwardRef, Fragment, memo } from 'react';
|
||||||
import Alert from '@mui/material/Alert';
|
import Alert from '@mui/material/Alert';
|
||||||
import AlertTitle from '@mui/material/AlertTitle';
|
import AlertTitle from '@mui/material/AlertTitle';
|
||||||
@@ -55,7 +55,13 @@ export const SnackbarWithDescription = memo(
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<SnackbarContent ref={ref}>
|
<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>
|
<TitleComponent>{message}</TitleComponent>
|
||||||
{actualDescription}
|
{actualDescription}
|
||||||
{isDescriptionTooLong ? (
|
{isDescriptionTooLong ? (
|
||||||
|
|||||||
Reference in New Issue
Block a user