Merge pull request #793 from gaeulbyul/patch-1

Fix checking prefers-color-scheme media query
This commit is contained in:
Mike Cao authored and GitHub committed 2021-09-23 09:53:08 -07:00
commit f1520fbb29
1 file changed
+1 -1
+1 -1
View File
@@ -7,7 +7,7 @@ import { useEffect } from 'react';
export default function useTheme() {
const defaultTheme =
typeof window !== 'undefined'
? window?.matchMedia('prefers-color-scheme: dark')?.matches
? window?.matchMedia('(prefers-color-scheme: dark)')?.matches
? 'dark'
: 'light'
: 'light';