Ship Expo Router screens, seeded stores, and polished UX so auth, shop, checkout, prescriptions, loyalty, family, and account processes work end-to-end offline. Co-authored-by: Cursor <cursoragent@cursor.com>
24 lines
555 B
TypeScript
24 lines
555 B
TypeScript
import AsyncStorage from "@react-native-async-storage/async-storage";
|
|
import { create } from "zustand";
|
|
import { createJSONStorage, persist } from "zustand/middleware";
|
|
|
|
export type Language = "en" | "am";
|
|
|
|
type LangState = {
|
|
language: Language;
|
|
setLanguage: (language: Language) => void;
|
|
};
|
|
|
|
export const useLangStore = create<LangState>()(
|
|
persist(
|
|
(set) => ({
|
|
language: "en",
|
|
setLanguage: (language) => set({ language }),
|
|
}),
|
|
{
|
|
name: "gishen-lang",
|
|
storage: createJSONStorage(() => AsyncStorage),
|
|
}
|
|
)
|
|
);
|