most working data fetch.

This commit is contained in:
2025-06-30 13:34:27 -04:00
parent c3151f380b
commit 5c046874a8
7 changed files with 128 additions and 149 deletions
+3 -5
View File
@@ -15,14 +15,12 @@ export function ThemeProvider({ children }: { children: React.ReactNode }) {
const [theme, setTheme] = useState<Theme>('light');
useEffect(() => {
// Check for saved theme preference or default to light mode
// Only use saved theme preference, otherwise default to light
const savedTheme = localStorage.getItem('theme') as Theme;
const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
if (savedTheme) {
setTheme(savedTheme);
} else if (prefersDark) {
setTheme('dark');
} else {
setTheme('light');
}
}, []);