Skip to content

Commit 827f2cf

Browse files
committed
feat: Create separated file for authModalStore.
1 parent 240e15b commit 827f2cf

3 files changed

Lines changed: 14 additions & 12 deletions

File tree

src/features/auth/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
export * from './components/AuthModal'
22
export * from './hooks/useAuth'
3+
export * from './stores/authModalStore'
34
export * from './stores/authStore'
45
export * from './types'
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { create } from 'zustand'
2+
3+
interface AuthModalState {
4+
isAuthModalOpen: boolean
5+
openAuthModal: () => void
6+
closeAuthModal: () => void
7+
}
8+
9+
export const AuthModalStore = create<AuthModalState>((set) => ({
10+
isAuthModalOpen: false,
11+
openAuthModal: () => set({ isAuthModalOpen: true }),
12+
closeAuthModal: () => set({ isAuthModalOpen: false }),
13+
}))

src/features/auth/stores/authStore.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,6 @@ import { User } from 'src/features/auth/types'
22
import { create } from 'zustand'
33
import { persist } from 'zustand/middleware'
44

5-
interface AuthModalState {
6-
isAuthModalOpen: boolean
7-
openAuthModal: () => void
8-
closeAuthModal: () => void
9-
}
10-
115
type AuthState = {
126
idToken: string | null
137
user: User | null
@@ -18,12 +12,6 @@ type AuthActions = {
1812
clear: () => void
1913
}
2014

21-
export const AuthModalStore = create<AuthModalState>((set) => ({
22-
isAuthModalOpen: false,
23-
openAuthModal: () => set({ isAuthModalOpen: true }),
24-
closeAuthModal: () => set({ isAuthModalOpen: false }),
25-
}))
26-
2715
export const AuthStore = create(
2816
persist<AuthState & AuthActions>(
2917
(set) => ({

0 commit comments

Comments
 (0)