mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 06:28:51 +00:00
working notification
This commit is contained in:
1 parent
7d27a6bddf
commit
b2466f0e15
12 files changed
+236
-13
No files matched your search
@@ -0,0 +1,40 @@
|
||||
import React from "react";
|
||||
import { ThemeProvider } from "@material-ui/core";
|
||||
import Paper from '@material-ui/core/Paper';
|
||||
import Snackbar from '@material-ui/core/Snackbar';
|
||||
import Fade from '@material-ui/core/Fade';
|
||||
import { makeStyles } from "@material-ui/core/styles";
|
||||
import { useSettings } from "../../apps/settings/hooks/useSettings";
|
||||
|
||||
const useStyles = makeStyles({
|
||||
paper: {
|
||||
width: '350px',
|
||||
height: '85px',
|
||||
opacity: '0.93',
|
||||
}
|
||||
});
|
||||
|
||||
function Notification({ key, children, handleClose, open }) {
|
||||
const classes = useStyles();
|
||||
const { currentTheme } = useSettings();
|
||||
return (
|
||||
<ThemeProvider theme={currentTheme()}>
|
||||
<Snackbar
|
||||
key={key}
|
||||
anchorOrigin={{ vertical: 'top', horizontal: 'left' }}
|
||||
ClickAwayListenerProps={{ onClickAway: () => null }}
|
||||
onClose={handleClose}
|
||||
open={open}
|
||||
TransitionComponent={Fade}
|
||||
autoHideDuration={6000}
|
||||
>
|
||||
<Paper className={classes.paper}>
|
||||
{children}
|
||||
</Paper>
|
||||
</Snackbar>
|
||||
</ThemeProvider>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
export default Notification;
|
||||
Reference in new issue
Block a user