diff --git a/src/App.js b/src/App.js index 7f84fe53..cbe79b08 100644 --- a/src/App.js +++ b/src/App.js @@ -31,7 +31,7 @@ export default function App() { else { document.body.classList.remove('dark-mode') } - forceUpdate(); + forceUpdate(); }, []); return ( diff --git a/src/Components/Navbar.js b/src/Components/Navbar.js index 2540dc7a..93b4d996 100644 --- a/src/Components/Navbar.js +++ b/src/Components/Navbar.js @@ -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(); };