store theme selection in localstorage

This commit is contained in:
code002lover 2025-12-19 14:08:54 +01:00
parent 5b397e2265
commit d1b65231a6

View File

@ -24,7 +24,13 @@ function App() {
const [token, setToken] = useState<string>(
localStorage.getItem("token") || ""
);
const [theme, setTheme] = useState<string>("default");
const [theme, _setTheme] = useState<string>(
localStorage.getItem("theme") || "default"
);
const setTheme = (theme: string) => {
_setTheme(theme);
localStorage.setItem("theme", theme);
};
const [toasts, setToasts] = useState<ToastMessage[]>([]);
const [isLoading, setIsLoading] = useState(false);