ACTUALLY fix the dark mode
This commit is contained in:
parent
6f6a69c6de
commit
42331f7334
@ -1,4 +1,4 @@
|
|||||||
import React, { useEffect } from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import * as BS from 'react-bootstrap'
|
import * as BS from 'react-bootstrap'
|
||||||
import Toggle from 'react-toggle'
|
import Toggle from 'react-toggle'
|
||||||
@ -11,11 +11,11 @@ const Navbar = ({ setIsSubmit, forceUpdate}) => {
|
|||||||
function toggleDarkMode() {
|
function toggleDarkMode() {
|
||||||
if (localStorage.getItem("pk-darkmode")) {
|
if (localStorage.getItem("pk-darkmode")) {
|
||||||
localStorage.removeItem("pk-darkmode");
|
localStorage.removeItem("pk-darkmode");
|
||||||
document.body.classList.add('dark-mode')
|
document.body.classList.remove('dark-mode')
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
localStorage.setItem("pk-darkmode", "true");
|
localStorage.setItem("pk-darkmode", "true");
|
||||||
document.body.classList.remove('dark-mode')
|
document.body.classList.add('dark-mode')
|
||||||
}
|
}
|
||||||
forceUpdate();
|
forceUpdate();
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user