base structure

This commit is contained in:
hamid zarghami
2025-08-03 09:12:48 +03:30
parent 866618a5bc
commit 61a934074c
9 changed files with 234 additions and 6 deletions
+9
View File
@@ -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 }),
}));
+37
View File
@@ -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
}>;
};
}>;