localstorage

pull/1/head
Francesco Minnocci 2 years ago
parent 2dda03dd8a
commit 360fa42606
Signed by: BachoSeven
GPG Key ID: 2BE4AB7FDAD828A4

@ -103,9 +103,10 @@ const App = ({}) => {
setEventi(eventi)
}, [source])
const [theme, setTheme] = useState("light")
const [theme, setTheme] = useState(localStorage.getItem("theme") ?? "light")
document.body.classList.toggle("dark-mode", theme === "dark")
localStorage.setItem("theme", theme)
return (
<>

Loading…
Cancel
Save