mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-05 06:28:51 +00:00
fix(phone/notification-comp): Fix reference to old theme config
This commit is contained in:
1 parent
214da78056
commit
b1b83b5021
1 file changed
+4
-7
@@ -2,13 +2,11 @@ import React from 'react';
|
|||||||
import Paper from '@material-ui/core/Paper';
|
import Paper from '@material-ui/core/Paper';
|
||||||
import Snackbar from '@material-ui/core/Snackbar';
|
import Snackbar from '@material-ui/core/Snackbar';
|
||||||
import Fade from '@material-ui/core/Fade';
|
import Fade from '@material-ui/core/Fade';
|
||||||
import { createMuiTheme, ThemeProvider } from '@material-ui/core';
|
import { ThemeProvider } from '@material-ui/core';
|
||||||
import { makeStyles } from '@material-ui/core/styles';
|
import { makeStyles } from '@material-ui/core/styles';
|
||||||
import { usePhone } from '../../os/phone/hooks/usePhone';
|
import { usePhone } from '../../os/phone/hooks/usePhone';
|
||||||
|
|
||||||
import { useRecoilState } from 'recoil';
|
import { usePhoneTheme } from '../../os/phone/hooks/usePhoneTheme';
|
||||||
import { settingsState } from '../../apps/settings/hooks/useSettings';
|
|
||||||
import themeConfig from '../../config/default.json';
|
|
||||||
|
|
||||||
const useStyles = makeStyles({
|
const useStyles = makeStyles({
|
||||||
paper: {
|
paper: {
|
||||||
@@ -25,15 +23,14 @@ function Notification({ children, handleClose, open }) {
|
|||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
const { config } = usePhone();
|
const { config } = usePhone();
|
||||||
|
|
||||||
const [settings] = useRecoilState(settingsState);
|
const currentTheme = usePhoneTheme();
|
||||||
|
|
||||||
if (!config) return null;
|
if (!config) return null;
|
||||||
|
|
||||||
const { horizontal, vertical } = config.notificationPosition;
|
const { horizontal, vertical } = config.notificationPosition;
|
||||||
const currentTheme = () => createMuiTheme(themeConfig.themes[settings.theme.value]);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ThemeProvider theme={currentTheme()}>
|
<ThemeProvider theme={currentTheme}>
|
||||||
<Snackbar
|
<Snackbar
|
||||||
className={classes.snackBar}
|
className={classes.snackBar}
|
||||||
anchorOrigin={{ horizontal, vertical }}
|
anchorOrigin={{ horizontal, vertical }}
|
||||||
|
|||||||
Reference in new issue
Block a user