themes and dimensions

This commit is contained in:
Owen Rees
2023-06-12 15:41:09 +02:00
parent 95f0a37c76
commit 254d4603aa
18 changed files with 204 additions and 34 deletions
+23
View File
@@ -0,0 +1,23 @@
"use client";
import { MdOutlineDarkMode, MdLightbulbOutline } from "react-icons/md";
import useDarkMode from "@/hooks/useDarkMode";
// TODO write tests for light/mode
// TODO new SVG for light/dark theme
// TODO fix TS error on setTheme
const ThemeSwitcher = () => {
const [colorTheme, setTheme] = useDarkMode();
return (
<>
{colorTheme === "light" ? (
<MdOutlineDarkMode onClick={() => setTheme("light")} />
) : (
<MdLightbulbOutline onClick={() => setTheme("dark")} />
)}
</>
);
};
export default ThemeSwitcher;