fitst commit
This commit is contained in:
20
screens/auth/login/lib/storage.ts
Normal file
20
screens/auth/login/lib/storage.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { create } from 'zustand';
|
||||
|
||||
type State = {
|
||||
phone: string | null;
|
||||
userType: string | null;
|
||||
};
|
||||
|
||||
type Actions = {
|
||||
savedPhone: (phone: string | null) => void;
|
||||
savedUserType: (userType: string | null) => void;
|
||||
};
|
||||
|
||||
const userInfoStore = create<State & Actions>((set) => ({
|
||||
phone: null,
|
||||
savedPhone: (phone: string | null) => set(() => ({ phone })),
|
||||
userType: null,
|
||||
savedUserType: (userType: string | null) => set(() => ({ userType })),
|
||||
}));
|
||||
|
||||
export default userInfoStore;
|
||||
Reference in New Issue
Block a user