diff --git a/frontend/src/layouts/dashboard/layout.js b/frontend/src/layouts/dashboard/layout.js index 104db95..3dddca3 100644 --- a/frontend/src/layouts/dashboard/layout.js +++ b/frontend/src/layouts/dashboard/layout.js @@ -4,6 +4,8 @@ import { styled } from '@mui/material/styles'; import { withAuthGuard } from 'src/hocs/with-auth-guard'; import { SideNav } from './side-nav'; import { TopNav } from './top-nav'; +import { useAlertContext } from 'src/contexts/error-context'; +import { Alert, AlertTitle, Snackbar } from '@mui/material'; const SIDE_NAV_WIDTH = 280; @@ -28,6 +30,8 @@ export const Layout = withAuthGuard((props) => { const pathname = usePathname(); const [openNav, setOpenNav] = useState(false); + const {alert, setAlert} = useAlertContext(); + const handlePathnameChange = useCallback( () => { if (openNav) { @@ -57,6 +61,21 @@ export const Layout = withAuthGuard((props) => { {children} + {alert && setAlert(null)} + > + + {alert?.title && {alert.title}} + {alert?.message} + + } ); }); \ No newline at end of file