Files
Checkmate/client/src/App.tsx
T

46 lines
1.2 KiB
TypeScript
Raw Normal View History

2026-02-12 19:16:16 +00:00
import { type CSSProperties } from "react";
import { useSelector } from "react-redux";
import "react-toastify/dist/ReactToastify.css";
import { ToastContainer } from "react-toastify";
2024-08-28 22:14:55 -04:00
import { ThemeProvider } from "@emotion/react";
import lightTheme from "./Utils/Theme/lightTheme";
import darkTheme from "./Utils/Theme/darkTheme";
import { CssBaseline, GlobalStyles } from "@mui/material";
import { Routes } from "./Routes";
2026-02-10 17:53:00 +00:00
import AppLayout from "@/Components/v2/layout/AppLayout";
2026-02-09 23:51:18 +00:00
import type { RootState } from "@/Types/state";
function App() {
2026-02-09 23:51:18 +00:00
const mode = useSelector((state: RootState) => state.ui.mode);
2024-08-28 22:14:55 -04:00
const theme = mode === "light" ? lightTheme : darkTheme;
return (
<ThemeProvider theme={theme}>
2025-10-08 13:44:41 -07:00
<CssBaseline />
<GlobalStyles
styles={{
body: {
2026-02-09 23:51:18 +00:00
// @ts-ignore
backgroundColor: theme.palette.background.main,
},
}}
/>
2025-10-08 13:44:41 -07:00
<AppLayout>
<Routes />
</AppLayout>
2026-01-26 02:37:59 +00:00
<ToastContainer
newestOnTop={true}
theme={mode}
2026-02-09 23:51:18 +00:00
style={
{
"--toastify-color-progress-light": "#7C8BA1",
"--toastify-color-progress-dark": "#7C8BA1",
} as CSSProperties
}
2026-01-26 02:37:59 +00:00
/>
</ThemeProvider>
);
}
2024-05-11 22:48:09 +03:30
export default App;