From 7f5df0b4b2a1c4ac0dbf47f6be087584453e37db Mon Sep 17 00:00:00 2001 From: Franek Date: Sat, 29 Mar 2025 19:58:47 +0100 Subject: [PATCH] invert theme logic (light theme by default) --- src/style/themes.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/style/themes.tsx b/src/style/themes.tsx index 2b442bb..8444dd4 100644 --- a/src/style/themes.tsx +++ b/src/style/themes.tsx @@ -32,14 +32,14 @@ const ThemeContext = createContext({ }); const ThemeProvider: React.FC = ({ children }) => { - const [isLightTheme, setIsLightTheme] = useState(() => localStorage.getItem("theme") === "light"); + const [isDarkTheme, setIsDarkTheme] = useState(() => localStorage.getItem("theme") === "dark"); useEffect(() => { - localStorage.setItem("theme", isLightTheme ? "light" : "dark"); - }, [isLightTheme]); + localStorage.setItem("theme", isDarkTheme ? "dark" : "light"); + }, [isDarkTheme]); - const theme = isLightTheme ? lightTheme : darkTheme; - const toggleTheme = () => setIsLightTheme(prev => !prev); + const theme = isDarkTheme ? darkTheme : lightTheme; + const toggleTheme = () => setIsDarkTheme(prev => !prev); return (