mirror of
https://github.com/movie-web/native-app.git
synced 2025-09-13 18:13:25 +00:00
refactor to tamagui
This commit is contained in:
20
apps/expo/src/stores/theme/index.ts
Normal file
20
apps/expo/src/stores/theme/index.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { create } from "zustand";
|
||||
import { immer } from "zustand/middleware/immer";
|
||||
|
||||
export type ThemeStoreOption = "main" | "blue" | "gray" | "red" | "teal";
|
||||
|
||||
export interface ThemeStore {
|
||||
theme: ThemeStoreOption;
|
||||
setTheme(v: ThemeStoreOption): void;
|
||||
}
|
||||
|
||||
export const useThemeStore = create(
|
||||
immer<ThemeStore>((set) => ({
|
||||
theme: "main",
|
||||
setTheme(v) {
|
||||
set((s) => {
|
||||
s.theme = v;
|
||||
});
|
||||
},
|
||||
})),
|
||||
);
|
Reference in New Issue
Block a user