42 lines
1 KiB
TypeScript
42 lines
1 KiB
TypeScript
export const useAppStore = defineStore('app', () => {
|
|
const activeAuthState = ref<string>('');
|
|
|
|
const setActiveAuthState = (state: string) => {
|
|
activeAuthState.value = state;
|
|
};
|
|
const unsetActiveAuthState = () => {
|
|
activeAuthState.value = '';
|
|
};
|
|
|
|
const isRegister = computed<boolean>(() => activeAuthState.value === 'register');
|
|
const isLogin = computed<boolean>(() => activeAuthState.value === 'login');
|
|
const isForgot = computed<boolean>(() => activeAuthState.value === 'reset-password');
|
|
const isReset = computed<boolean>(() => activeAuthState.value === 'new-password');
|
|
|
|
const isOverflowHidden = ref<boolean>(false);
|
|
const setOverflowHidden = (value: boolean) => {
|
|
isOverflowHidden.value = value;
|
|
};
|
|
|
|
const isDemoSettings = ref<boolean>(false);
|
|
const setDemoSettings = (value: boolean) => {
|
|
isDemoSettings.value = value;
|
|
};
|
|
|
|
return {
|
|
activeAuthState,
|
|
setActiveAuthState,
|
|
unsetActiveAuthState,
|
|
|
|
isRegister,
|
|
isLogin,
|
|
isForgot,
|
|
isReset,
|
|
|
|
isOverflowHidden,
|
|
setOverflowHidden,
|
|
|
|
isDemoSettings,
|
|
setDemoSettings,
|
|
};
|
|
});
|