base structure
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
import { create } from "zustand";
|
||||
import { SharedStoreType } from "../types/SharedTypes";
|
||||
|
||||
export const useSharedStore = create<SharedStoreType>((set) => ({
|
||||
openSidebar: false,
|
||||
setOpenSidebar: (value) => set({ openSidebar: value }),
|
||||
isLogin: false,
|
||||
setIsLogin: (value) => set({ isLogin: value }),
|
||||
}));
|
||||
@@ -0,0 +1,37 @@
|
||||
export type SharedStoreType = {
|
||||
openSidebar: boolean;
|
||||
setOpenSidebar: (value: boolean) => void;
|
||||
|
||||
isLogin: boolean;
|
||||
setIsLogin: (value: boolean) => void;
|
||||
};
|
||||
|
||||
export interface ApiResponse<T> {
|
||||
statusCode: number;
|
||||
success: boolean;
|
||||
data: T;
|
||||
}
|
||||
|
||||
export type UserMeResponseType = ApiResponse<{
|
||||
user: {
|
||||
id: string;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
firstName: string;
|
||||
lastName: string;
|
||||
email: string;
|
||||
emailVerified: boolean;
|
||||
phone: string;
|
||||
birthDate: string;
|
||||
nationalCode: string;
|
||||
financialType: string;
|
||||
profilePic: string | null;
|
||||
userName: string | null;
|
||||
roles: Array<{
|
||||
id: string;
|
||||
createdAt: string;
|
||||
name: string;
|
||||
// Add other role properties as needed
|
||||
}>;
|
||||
};
|
||||
}>;
|
||||
Reference in New Issue
Block a user