wip
This commit is contained in:
16
lib/client/storage.ts
Normal file
16
lib/client/storage.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
// lib/client/storage.ts
|
||||
export const CLIENT_STORAGE_KEYS = {
|
||||
THEME: "theme",
|
||||
LANG: "lang"
|
||||
} as const;
|
||||
|
||||
export const getInitialState = () => {
|
||||
if (typeof window === "undefined") return {};
|
||||
|
||||
return {
|
||||
uiStore: {
|
||||
theme: localStorage.getItem(CLIENT_STORAGE_KEYS.THEME) || "light",
|
||||
language: localStorage.getItem(CLIENT_STORAGE_KEYS.LANG) || "zh-CN"
|
||||
}
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user