mirror of
https://github.com/Radiquum/AniX.git
synced 2025-05-01 18:39:40 +05:00
frontend:
Fix undefined api call Simplify some parts Better theme management Add color picker (dynamic themes wohoo) Add missing lists keys
This commit is contained in:
parent
17b5693f34
commit
79782b4228
8 changed files with 157 additions and 137 deletions
|
@ -1,5 +1,10 @@
|
|||
"use client";
|
||||
import { create } from "zustand";
|
||||
export function setMode(mode) {
|
||||
localStorage.setItem("mode", mode);
|
||||
}
|
||||
export function getMode() {
|
||||
return localStorage.getItem("mode");
|
||||
}
|
||||
|
||||
export function setTheme(theme) {
|
||||
localStorage.setItem("theme", theme);
|
||||
|
@ -8,13 +13,3 @@ export function getTheme() {
|
|||
return localStorage.getItem("theme");
|
||||
}
|
||||
|
||||
export const useThemeStore = create((set) => ({
|
||||
theme: "light",
|
||||
changeTheme: (theme) => {
|
||||
set({ theme: theme });
|
||||
setTheme(theme);
|
||||
},
|
||||
checkTheme: () => {
|
||||
set({ theme: getTheme() || "light" });
|
||||
}
|
||||
}));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue