From c6268d52b26c959d6341d128439f8764a3f9698d Mon Sep 17 00:00:00 2001 From: Qing Date: Thu, 20 Oct 2022 21:06:53 +0800 Subject: [PATCH] use dark theme by default --- .../app/src/components/Header/ThemeChanger.tsx | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/lama_cleaner/app/src/components/Header/ThemeChanger.tsx b/lama_cleaner/app/src/components/Header/ThemeChanger.tsx index 17c11c5..25888c6 100644 --- a/lama_cleaner/app/src/components/Header/ThemeChanger.tsx +++ b/lama_cleaner/app/src/components/Header/ThemeChanger.tsx @@ -4,21 +4,12 @@ import { SunIcon, MoonIcon } from '@heroicons/react/outline' export const themeState = atom({ key: 'themeState', - default: 'light', + default: 'dark', }) export const ThemeChanger = () => { const [theme, setTheme] = useRecoilState(themeState) - useEffect(() => { - const darkThemeMq = window.matchMedia('(prefers-color-scheme: dark)') - if (darkThemeMq.matches) { - setTheme('dark') - } else { - setTheme('light') - } - }, [setTheme]) - const themeSwitchHandler = () => { const newTheme = theme === 'light' ? 'dark' : 'light' setTheme(newTheme)