mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-08 06:47:56 +00:00
fix the dark mode so it shows up on popups
This commit is contained in:
parent
283bd5f8fb
commit
884f600d3e
3 changed files with 23 additions and 16 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import React from 'react';
|
||||
import React, { useEffect } from 'react';
|
||||
|
||||
import * as BS from 'react-bootstrap'
|
||||
import Toggle from 'react-toggle'
|
||||
|
|
@ -9,9 +9,14 @@ import history from "../History.js";
|
|||
const Navbar = ({ setIsSubmit, forceUpdate}) => {
|
||||
|
||||
function toggleDarkMode() {
|
||||
if (localStorage.getItem("pk-darkmode"))
|
||||
if (localStorage.getItem("pk-darkmode")) {
|
||||
localStorage.removeItem("pk-darkmode");
|
||||
else localStorage.setItem("pk-darkmode", "true");
|
||||
document.body.classList.add('dark-mode')
|
||||
}
|
||||
else {
|
||||
localStorage.setItem("pk-darkmode", "true");
|
||||
document.body.classList.remove('dark-mode')
|
||||
}
|
||||
forceUpdate();
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue