This commit is contained in:
砂糖
2026-01-24 16:54:44 +08:00
commit 70f337bb92
186 changed files with 23792 additions and 0 deletions

22
stores/localeStore.ts Normal file
View File

@@ -0,0 +1,22 @@
import Cookies from 'js-cookie';
import { create } from 'zustand';
interface LocaleState {
showLanguageAlert: boolean
setShowLanguageAlert: (show: boolean) => void
dismissLanguageAlert: () => void
getLangAlertDismissed: () => boolean
}
export const useLocaleStore = create<LocaleState>((set) => ({
showLanguageAlert: false,
setShowLanguageAlert: (show) => set({ showLanguageAlert: show }),
dismissLanguageAlert: () => {
// cookie expires 30 days
Cookies.set("langAlertDismissed", "true", { expires: 30 });
set({ showLanguageAlert: false });
},
getLangAlertDismissed: () => {
return Cookies.get("langAlertDismissed") === "true";
},
}))