Skip to content

Commit 0bec1a7

Browse files
committed
fix: specify theme type in ThemeProvider
1 parent f638cb8 commit 0bec1a7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

web/src/context/ThemeProvider.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@ import React, { useEffect } from "react";
22
import { useLocalStorage } from "hooks/useLocalStorage";
33
import { ToggleThemeProvider } from "hooks/useToggleThemeContext";
44

5+
type Theme = "light" | "dark";
6+
57
const ThemeProvider: React.FC<{
68
children: React.ReactNode;
79
}> = ({ children }) => {
8-
const [theme, setTheme] = useLocalStorage<string>("theme", "dark");
10+
const [theme, setTheme] = useLocalStorage<Theme>("theme", "dark");
911

1012
const toggleTheme = () => {
1113
if (theme === "light") setTheme("dark");

0 commit comments

Comments
 (0)