diff --git a/src/components/Reagan.jsx b/src/components/Reagan.jsx index 923b633..fe76b4f 100644 --- a/src/components/Reagan.jsx +++ b/src/components/Reagan.jsx @@ -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 (