File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11export * from './components/AuthModal'
22export * from './hooks/useAuth'
3+ export * from './stores/authModalStore'
34export * from './stores/authStore'
45export * from './types'
Original file line number Diff line number Diff line change 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+ } ) )
Original file line number Diff line number Diff line change @@ -2,12 +2,6 @@ import { User } from 'src/features/auth/types'
22import { create } from 'zustand'
33import { persist } from 'zustand/middleware'
44
5- interface AuthModalState {
6- isAuthModalOpen : boolean
7- openAuthModal : ( ) => void
8- closeAuthModal : ( ) => void
9- }
10-
115type 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-
2715export const AuthStore = create (
2816 persist < AuthState & AuthActions > (
2917 ( set ) => ( {
You can’t perform that action at this time.
0 commit comments