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 (