From 1ff86576dae322daa7ab59537a07d3ed971b34b9 Mon Sep 17 00:00:00 2001 From: GuillaumeSD <47183782+GuillaumeSD@users.noreply.github.com> Date: Sun, 11 May 2025 23:38:27 +0200 Subject: [PATCH] style : appBar color --- src/sections/engineSettings/engineSettingsDialog.tsx | 2 +- src/sections/layout/NavBar.tsx | 6 +++++- src/sections/layout/index.tsx | 12 ++++++------ 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/sections/engineSettings/engineSettingsDialog.tsx b/src/sections/engineSettings/engineSettingsDialog.tsx index 4cf19fb..c409eac 100644 --- a/src/sections/engineSettings/engineSettingsDialog.tsx +++ b/src/sections/engineSettings/engineSettingsDialog.tsx @@ -183,7 +183,7 @@ export default function EngineSettingsDialog({ open, onClose }: Props) { diff --git a/src/sections/layout/NavBar.tsx b/src/sections/layout/NavBar.tsx index fe7833d..aacd638 100644 --- a/src/sections/layout/NavBar.tsx +++ b/src/sections/layout/NavBar.tsx @@ -27,7 +27,11 @@ export default function NavBar({ darkMode, switchDarkMode }: Props) { theme.zIndex.drawer + 1 }} + sx={{ + zIndex: (theme) => theme.zIndex.drawer + 1, + backgroundColor: darkMode ? "#19191c" : "white", + color: darkMode ? "white" : "black", + }} enableColorOnDark > diff --git a/src/sections/layout/index.tsx b/src/sections/layout/index.tsx index c9b700a..87d5c2a 100644 --- a/src/sections/layout/index.tsx +++ b/src/sections/layout/index.tsx @@ -5,13 +5,13 @@ import { red } from "@mui/material/colors"; import { useLocalStorage } from "@/hooks/useLocalStorage"; export default function Layout({ children }: PropsWithChildren) { - const [useDarkMode, setDarkMode] = useLocalStorage("useDarkMode", true); + const [isDarkMode, setDarkMode] = useLocalStorage("useDarkMode", true); const theme = useMemo( () => createTheme({ palette: { - mode: useDarkMode ? "dark" : "light", + mode: isDarkMode ? "dark" : "light", error: { main: red[400], }, @@ -19,20 +19,20 @@ export default function Layout({ children }: PropsWithChildren) { main: "#5d9948", }, secondary: { - main: useDarkMode ? "#424242" : "#ffffff", + main: isDarkMode ? "#424242" : "#ffffff", }, }, }), - [useDarkMode] + [isDarkMode] ); - if (useDarkMode === null) return null; + if (isDarkMode === null) return null; return ( setDarkMode((val) => !val)} />
{children}