From 42331f73340bbe539f14e256d41c4699b5da0b24 Mon Sep 17 00:00:00 2001 From: Spectralitree <72747870+Spectralitree@users.noreply.github.com> Date: Sun, 3 Oct 2021 19:24:30 +0200 Subject: [PATCH] ACTUALLY fix the dark mode --- src/App.js | 2 +- src/Components/Navbar.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) 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(); };