Skip to content

Commit

Permalink
automatic Reagan mode
Browse files Browse the repository at this point in the history
  • Loading branch information
mrkyns committed Apr 21, 2023
1 parent 4ff928c commit cd24aac
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/components/Reagan.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
import { useState } from "react";
import { useState, useEffect } from "react";

export default function Reagan() {
const [active, setActive] = useState(false);

useEffect(() => {
if (
window.matchMedia &&
window.matchMedia("(prefers-color-scheme: dark)").matches
) {
document.body.classList.add("reagan_mod");
setActive(!active);
}
}, []);

return (
<div
onClick={function toggleBtn() {
Expand Down

0 comments on commit cd24aac

Please sign in to comment.