mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 14:38:45 +00:00
Feat: Settings localStorage state
This commit is contained in:
commit
73a5bab1c7
15 files changed
+120
-122
No files matched your search
@@ -1,17 +1,16 @@
|
||||
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";
|
||||
import { usePhone } from "../../os/phone/hooks/usePhone";
|
||||
import React from 'react';
|
||||
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';
|
||||
import { usePhone } from '../../os/phone/hooks/usePhone';
|
||||
|
||||
const useStyles = makeStyles({
|
||||
paper: {
|
||||
width: "350px",
|
||||
height: "100px",
|
||||
opacity: "0.93",
|
||||
width: '350px',
|
||||
height: '100px',
|
||||
opacity: '0.93',
|
||||
},
|
||||
snackBar: {
|
||||
zIndex: -5, // we want this to appear behind other active NUI events...probably
|
||||
@@ -20,7 +19,7 @@ const useStyles = makeStyles({
|
||||
|
||||
function Notification({ children, handleClose, open }) {
|
||||
const classes = useStyles();
|
||||
const { currentTheme } = useSettings();
|
||||
const [settings] = useSettings();
|
||||
const { config } = usePhone();
|
||||
|
||||
if (!config) return null;
|
||||
@@ -28,19 +27,22 @@ function Notification({ children, handleClose, open }) {
|
||||
const { horizontal, vertical } = config.notificationPosition;
|
||||
|
||||
return (
|
||||
<ThemeProvider theme={currentTheme()}>
|
||||
<Snackbar
|
||||
className={classes.snackBar}
|
||||
anchorOrigin={{ horizontal, vertical }}
|
||||
ClickAwayListenerProps={{ onClickAway: () => setTimeout(() => { handleClose() }, 5000) }}
|
||||
onClose={handleClose}
|
||||
open={open}
|
||||
TransitionComponent={Fade}
|
||||
autoHideDuration={6000}
|
||||
>
|
||||
<Paper className={classes.paper}>{children}</Paper>
|
||||
</Snackbar>
|
||||
</ThemeProvider>
|
||||
<Snackbar
|
||||
className={classes.snackBar}
|
||||
anchorOrigin={{ horizontal, vertical }}
|
||||
ClickAwayListenerProps={{
|
||||
onClickAway: () =>
|
||||
setTimeout(() => {
|
||||
handleClose();
|
||||
}, 5000),
|
||||
}}
|
||||
onClose={handleClose}
|
||||
open={open}
|
||||
TransitionComponent={Fade}
|
||||
autoHideDuration={6000}
|
||||
>
|
||||
<Paper className={classes.paper}>{children}</Paper>
|
||||
</Snackbar>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user