## Changes ### Sidebar - Remove hardcoded `backgroundColor: "#000000"` - Use `theme.palette.background.main` for dynamic theming - Update border color to use `theme.palette.border.light` ### Body Background - Remove hardcoded `background-color: #000000` from index.css - Add GlobalStyles in App.jsx to apply theme background to body element ## Benefits - Sidebar now properly displays in light mode - Body background adapts correctly to theme changes - Consistent theming across light and dark modes
46 lines
1.1 KiB
React
46 lines
1.1 KiB
React
import { useEffect } from "react";
|
|
import { useSelector } from "react-redux";
|
|
import "react-toastify/dist/ReactToastify.css";
|
|
import { ToastContainer } from "react-toastify";
|
|
import { ThemeProvider } from "@emotion/react";
|
|
import lightTheme from "./Utils/Theme/lightTheme";
|
|
import darkTheme from "./Utils/Theme/darkTheme";
|
|
import { CssBaseline, GlobalStyles } from "@mui/material";
|
|
import { logger } from "./Utils/Logger"; // Import the logger
|
|
import { networkService } from "./main";
|
|
import { Routes } from "./Routes";
|
|
import AppLayout from "@/Components/v1/Layouts/AppLayout";
|
|
|
|
function App() {
|
|
const mode = useSelector((state) => state.ui.mode);
|
|
|
|
// Cleanup
|
|
useEffect(() => {
|
|
return () => {
|
|
logger.cleanup();
|
|
networkService.cleanup();
|
|
};
|
|
}, []);
|
|
|
|
const theme = mode === "light" ? lightTheme : darkTheme;
|
|
|
|
return (
|
|
<ThemeProvider theme={theme}>
|
|
<CssBaseline />
|
|
<GlobalStyles
|
|
styles={{
|
|
body: {
|
|
backgroundColor: theme.palette.background.main,
|
|
},
|
|
}}
|
|
/>
|
|
<AppLayout>
|
|
<Routes />
|
|
</AppLayout>
|
|
<ToastContainer />
|
|
</ThemeProvider>
|
|
);
|
|
}
|
|
|
|
export default App;
|