mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 00:09:51 +03:00
remove unused colormode
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import { FC, createRef, createContext, useContext, useEffect, useState, RefObject } from 'react';
|
import { FC, createRef, useEffect, useState, RefObject } from 'react';
|
||||||
import { SnackbarProvider } from 'notistack';
|
import { SnackbarProvider } from 'notistack';
|
||||||
|
|
||||||
import { IconButton } from '@mui/material';
|
import { IconButton } from '@mui/material';
|
||||||
@@ -23,10 +23,6 @@ const App: FC = () => {
|
|||||||
notistackRef.current.closeSnackbar(key);
|
notistackRef.current.closeSnackbar(key);
|
||||||
};
|
};
|
||||||
|
|
||||||
const ColorModeContext = createContext({ toggleColorMode: () => {} });
|
|
||||||
|
|
||||||
const colorMode = useContext(ColorModeContext);
|
|
||||||
|
|
||||||
const [wasLoaded, setWasLoaded] = useState(false);
|
const [wasLoaded, setWasLoaded] = useState(false);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -36,26 +32,24 @@ const App: FC = () => {
|
|||||||
if (!wasLoaded) return null;
|
if (!wasLoaded) return null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ColorModeContext.Provider value={colorMode}>
|
<TypesafeI18n locale={detectedLocale}>
|
||||||
<TypesafeI18n locale={detectedLocale}>
|
<CustomTheme>
|
||||||
<CustomTheme>
|
<SnackbarProvider
|
||||||
<SnackbarProvider
|
maxSnack={3}
|
||||||
maxSnack={3}
|
anchorOrigin={{ vertical: 'bottom', horizontal: 'left' }}
|
||||||
anchorOrigin={{ vertical: 'bottom', horizontal: 'left' }}
|
ref={notistackRef}
|
||||||
ref={notistackRef}
|
action={(key) => (
|
||||||
action={(key) => (
|
<IconButton onClick={onClickDismiss(key)} size="small">
|
||||||
<IconButton onClick={onClickDismiss(key)} size="small">
|
<CloseIcon />
|
||||||
<CloseIcon />
|
</IconButton>
|
||||||
</IconButton>
|
)}
|
||||||
)}
|
>
|
||||||
>
|
<FeaturesLoader>
|
||||||
<FeaturesLoader>
|
<AppRouting />
|
||||||
<AppRouting />
|
</FeaturesLoader>
|
||||||
</FeaturesLoader>
|
</SnackbarProvider>
|
||||||
</SnackbarProvider>
|
</CustomTheme>
|
||||||
</CustomTheme>
|
</TypesafeI18n>
|
||||||
</TypesafeI18n>
|
|
||||||
</ColorModeContext.Provider>
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user