mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-03-21 18:04:39 -05:00
Planned to be replaced with Playwright maybe? Just removing in the meanwhile so they don't confuse people. Or that people won't accidentally develop new.
21 lines
588 B
TypeScript
21 lines
588 B
TypeScript
import { Theme, useTheme } from "~/modules/theme";
|
|
import { MoonIcon } from "../icons/Moon";
|
|
import { SunIcon } from "../icons/Sun";
|
|
|
|
export function ColorModeToggle() {
|
|
const [, setTheme] = useTheme();
|
|
|
|
const toggleTheme = () => {
|
|
setTheme((prevTheme) =>
|
|
prevTheme === Theme.LIGHT ? Theme.DARK : Theme.LIGHT
|
|
);
|
|
};
|
|
|
|
return (
|
|
<button className="layout__header__button" onClick={toggleTheme}>
|
|
<SunIcon className="light-mode-only layout__header__button__icon" />
|
|
<MoonIcon className="dark-mode-only layout__header__button__icon" />
|
|
</button>
|
|
);
|
|
}
|