store theme selection in localstorage
This commit is contained in:
parent
5b397e2265
commit
d1b65231a6
@ -24,7 +24,13 @@ function App() {
|
|||||||
const [token, setToken] = useState<string>(
|
const [token, setToken] = useState<string>(
|
||||||
localStorage.getItem("token") || ""
|
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 [toasts, setToasts] = useState<ToastMessage[]>([]);
|
||||||
const [isLoading, setIsLoading] = useState(false);
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user