diff --git a/src/core/store/ui/@types/tutorial.entity.ts b/src/core/store/ui/@types/tutorial.entity.ts new file mode 100644 index 0000000..d15b2b8 --- /dev/null +++ b/src/core/store/ui/@types/tutorial.entity.ts @@ -0,0 +1,4 @@ +export interface TutorialGlobalUIStore { + run: boolean; + setRun: (run: boolean) => void; +} diff --git a/src/core/store/ui/index.ts b/src/core/store/ui/index.ts index 403791e..050ec26 100644 --- a/src/core/store/ui/index.ts +++ b/src/core/store/ui/index.ts @@ -11,10 +11,13 @@ import { LoaderGlobalUIStore } from "./@types/loader.entity"; import { useLoaderSlice } from "./slices/loader.slice"; import { StepsGlobalUIStore } from "./@types/steps.entity"; import { useStepsSlice } from "./slices/steps.slice"; +import { useTutorialSlice } from "./slices/tutorial.slice"; +import { TutorialGlobalUIStore } from "./@types/tutorial.entity"; type GlobalUIState = ThemeGlobalUIStore & LoaderGlobalUIStore & - StepsGlobalUIStore; + StepsGlobalUIStore & + TutorialGlobalUIStore; const devtoolsOptions: DevtoolsOptions = { name: "Global UI State", @@ -51,6 +54,7 @@ export const useGlobalUIBoundedStore = create()( ...useThemeSlice(...a), ...useLoaderSlice(...a), ...useStepsSlice(...a), + ...useTutorialSlice(...a), }), devtoolsOptions, ), diff --git a/src/core/store/ui/slices/tutorial.slice.ts b/src/core/store/ui/slices/tutorial.slice.ts new file mode 100644 index 0000000..c77a5f3 --- /dev/null +++ b/src/core/store/ui/slices/tutorial.slice.ts @@ -0,0 +1,19 @@ +import { StateCreator } from "zustand"; +import { TutorialGlobalUIStore } from "../@types/tutorial.entity"; + +export const useTutorialSlice: StateCreator< + TutorialGlobalUIStore, + [["zustand/devtools", never]], + [], + TutorialGlobalUIStore +> = (set) => { + return { + // Stores + run: false, + + // Modifiers + setRun: (run: boolean) => { + set({ run }); + }, + }; +};