Replace prefers-color by localStorage for dark mode

This commit is contained in:
Cédric FAMIBELLE-PRONZOLA
2021-06-05 23:44:39 +02:00
parent 6c5782dd52
commit 7fba12cf60
2 changed files with 12 additions and 11 deletions
+1
View File
@@ -4,6 +4,7 @@ import Brightness3Icon from '@material-ui/icons/Brightness3'
export default function SwitchTheme({darkMode, setDarkMode}) {
const handleClick = () => {
localStorage.setItem('oki-dark', !darkMode)
setDarkMode(!darkMode)
}