From 17c2a3042f3d3508ec42a2b714c0cb1d513caab2 Mon Sep 17 00:00:00 2001 From: CyberL1 Date: Thu, 16 Jan 2025 17:11:50 +0100 Subject: [PATCH] feat: add auto dark mode based on user settings --- src/pages/App.tsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/pages/App.tsx b/src/pages/App.tsx index 5284480..65151a9 100644 --- a/src/pages/App.tsx +++ b/src/pages/App.tsx @@ -5,6 +5,7 @@ import "@fontsource/roboto/700.css"; import { AppBar, Box, + createTheme, Drawer, Icon, IconButton, @@ -13,6 +14,7 @@ import { ListItemButton, ListItemIcon, ListItemText, + ThemeProvider, Toolbar, Typography, } from "@mui/material"; @@ -37,11 +39,17 @@ const sidebarItems: Item[] = [ const drawerWidth = 240; +const darkTheme = createTheme({ + colorSchemes: { + dark: true, + }, +}); + function App({ error }: { error?: boolean }) { const [isOpen, setOpen] = useState(false); return ( - <> + theme.zIndex.drawer + 1 }} @@ -103,7 +111,7 @@ function App({ error }: { error?: boolean }) { {error && } {localStorage.getItem("key") ? : } - + ); }