mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-09-18 01:26:37 +08:00
* ⚡️ improve: delete google fonts * ⚡️ improve: Optimized priority input handling in TableRow component. * 🔖 chore: channel batch add * ✨ feat: add dark mod * ✨ feat: support token limit ip range and models * ✨ feat: add MessagePusher * ✨ feat: add lark login
53 lines
1.5 KiB
JavaScript
53 lines
1.5 KiB
JavaScript
import { useEffect } from 'react';
|
|
import { useSelector, useDispatch } from 'react-redux';
|
|
|
|
import { ThemeProvider } from '@mui/material/styles';
|
|
import { CssBaseline, StyledEngineProvider } from '@mui/material';
|
|
import { SET_THEME } from 'store/actions';
|
|
// routing
|
|
import Routes from 'routes';
|
|
|
|
// defaultTheme
|
|
import themes from 'themes';
|
|
|
|
// project imports
|
|
import NavigationScroll from 'layout/NavigationScroll';
|
|
|
|
// auth
|
|
import UserProvider from 'contexts/UserContext';
|
|
import StatusProvider from 'contexts/StatusContext';
|
|
import { SnackbarProvider } from 'notistack';
|
|
|
|
// ==============================|| APP ||============================== //
|
|
|
|
const App = () => {
|
|
const dispatch = useDispatch();
|
|
const customization = useSelector((state) => state.customization);
|
|
|
|
useEffect(() => {
|
|
const storedTheme = localStorage.getItem('theme');
|
|
if (storedTheme) {
|
|
dispatch({ type: SET_THEME, theme: storedTheme });
|
|
}
|
|
}, [dispatch]);
|
|
|
|
return (
|
|
<StyledEngineProvider injectFirst>
|
|
<ThemeProvider theme={themes(customization)}>
|
|
<CssBaseline />
|
|
<NavigationScroll>
|
|
<SnackbarProvider autoHideDuration={5000} maxSnack={3} anchorOrigin={{ vertical: 'top', horizontal: 'right' }}>
|
|
<UserProvider>
|
|
<StatusProvider>
|
|
<Routes />
|
|
</StatusProvider>
|
|
</UserProvider>
|
|
</SnackbarProvider>
|
|
</NavigationScroll>
|
|
</ThemeProvider>
|
|
</StyledEngineProvider>
|
|
);
|
|
};
|
|
|
|
export default App;
|