Make toasts appear above tail popups

This commit is contained in:
Martin Fournier
2022-01-08 09:59:31 -05:00
parent d2193e017d
commit 2b0a248673
2 changed files with 15 additions and 2 deletions
+12 -1
View File
@@ -1,16 +1,27 @@
import React, { useEffect } from "react";
import { useSnackbar, SnackbarProvider as SB } from "notistack";
import makeStyles from "@mui/styles/makeStyles";
import { EventEmitter } from "../../utils/EventEmitter";
import Alert from "@mui/material/Alert";
import Paper from "@mui/material/Paper";
import { logBoxBaseZIndex } from "./LogBoxManager";
interface IProps {
children: React.ReactNode | React.ReactNode[];
}
const useStyles = makeStyles(() => ({
snackbar: {
// Log popup z-index increments, so let's add a padding to be well above them.
zIndex: `${logBoxBaseZIndex + 1000} !important` as any,
}
}));
export function SnackbarProvider(props: IProps): React.ReactElement {
const classes = useStyles();
return (
<SB dense maxSnack={9} anchorOrigin={{ horizontal: "right", vertical: "bottom" }} autoHideDuration={2000}>
<SB dense maxSnack={9} anchorOrigin={{ horizontal: "right", vertical: "bottom" }} autoHideDuration={2000}
classes={{ containerRoot: classes.snackbar }}>
{props.children}
</SB>
);