We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f638cb8 commit 0bec1a7Copy full SHA for 0bec1a7
web/src/context/ThemeProvider.tsx
@@ -2,10 +2,12 @@ import React, { useEffect } from "react";
2
import { useLocalStorage } from "hooks/useLocalStorage";
3
import { ToggleThemeProvider } from "hooks/useToggleThemeContext";
4
5
+type Theme = "light" | "dark";
6
+
7
const ThemeProvider: React.FC<{
8
children: React.ReactNode;
9
}> = ({ children }) => {
- const [theme, setTheme] = useLocalStorage<string>("theme", "dark");
10
+ const [theme, setTheme] = useLocalStorage<Theme>("theme", "dark");
11
12
const toggleTheme = () => {
13
if (theme === "light") setTheme("dark");
0 commit comments