contexts.NotificationContext.js Maven / Gradle / Ivy
import React from 'react';
import { createContext } from 'react';
import { SnackbarProvider } from 'notistack';
import { Collapse, IconButton } from '@mui/material';
import { Close as CloseIcon } from '@mui/icons-material';
export const NotificationContext = createContext();
const NotificationProvider = ({children, ...props}) => {
const notistackRef = React.createRef();
const onClickDismiss = key => () => {
notistackRef.current.closeSnackbar(key);
}
return (
(
)}
sx={{
"& .SnackbarItem-action": {
"& .MuiButtonBase-root": {
color: "#ffffff"
}
}
}}
>
{children}
);
}
export default NotificationProvider;