Merge version_2 into main
Merge version_2 into main
This commit was merged in pull request #6.
This commit is contained in:
@@ -17,7 +17,6 @@ export default function LandingPage() {
|
||||
|
||||
const applyTheme = useCallback((theme: string) => {
|
||||
const isDarkTheme = theme === 'dark';
|
||||
setIsDark(isDarkTheme);
|
||||
|
||||
if (isDarkTheme) {
|
||||
document.documentElement.classList.add('dark');
|
||||
@@ -46,11 +45,11 @@ export default function LandingPage() {
|
||||
}
|
||||
|
||||
localStorage.setItem('theme', theme);
|
||||
setIsDark(isDarkTheme);
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
const theme = localStorage.getItem('theme') || 'light';
|
||||
setIsDark(theme === 'dark');
|
||||
applyTheme(theme);
|
||||
setMounted(true);
|
||||
}, [applyTheme]);
|
||||
|
||||
Reference in New Issue
Block a user