ACTUALLY fix the dark mode

This commit is contained in:
Spectralitree 2021-10-03 19:24:30 +02:00
parent 6f6a69c6de
commit 42331f7334
2 changed files with 4 additions and 4 deletions

View File

@ -31,7 +31,7 @@ export default function App() {
else {
document.body.classList.remove('dark-mode')
}
forceUpdate();
forceUpdate();
}, []);
return (

View File

@ -1,4 +1,4 @@
import React, { useEffect } from 'react';
import React from 'react';
import * as BS from 'react-bootstrap'
import Toggle from 'react-toggle'
@ -11,11 +11,11 @@ const Navbar = ({ setIsSubmit, forceUpdate}) => {
function toggleDarkMode() {
if (localStorage.getItem("pk-darkmode")) {
localStorage.removeItem("pk-darkmode");
document.body.classList.add('dark-mode')
document.body.classList.remove('dark-mode')
}
else {
localStorage.setItem("pk-darkmode", "true");
document.body.classList.remove('dark-mode')
document.body.classList.add('dark-mode')
}
forceUpdate();
};