base logig pages cart shipping and payment

This commit is contained in:
hamid zarghami
2025-09-14 12:47:51 +03:30
parent 7b05f96576
commit 6d52d1e91a
13 changed files with 663 additions and 82 deletions
+5 -1
View File
@@ -6,11 +6,13 @@ import { FC, Fragment, useEffect, useState } from 'react'
import Menu from './components/Menu'
import { useSharedStore } from './store/sharedStore'
import { getToken } from '@/config/func'
import { useGetProfile } from '@/app/profile/hooks/useProfileData'
const Header: FC = () => {
const [isMobileMenuOpen, setIsMobileMenuOpen] = useState(false)
const { setIsLogin } = useSharedStore()
const { data: profile } = useGetProfile()
const handleSetIsLogin = async () => {
const token = await getToken()
@@ -49,7 +51,9 @@ const Header: FC = () => {
<div className='flex items-center gap-1 sm:gap-2 md:gap-6'>
<div className='hidden md:flex h-10 border border-border py-3 px-4 rounded-[12px] items-center gap-2.5'>
<Profile size={20} color='#333333' />
<div className='text-sm text-[#333333]'>حساب کاربری</div>
{
<div className='text-sm text-[#333333]'>{profile?.results?.info?.fullName ? profile?.results?.info?.fullName : 'حساب کاربری'}</div>
}
</div>
<div className='md:hidden'>
+34 -16
View File
@@ -44,24 +44,42 @@ export type CategoryResponseType = ApiResponse<{
}>;
export type UserMeResponseType = ApiResponse<{
user: {
id: string;
info: {
_id: string;
fullName: string;
phoneNumber: string;
dateOfBirth: string | null;
address: string;
nationalCode: string | null;
homeNumber: string | null;
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;
userAddress: {
_id: string;
address: string;
city: {
_id: number;
name: string;
province: number;
createdAt: string;
updatedAt: string;
__v: number;
};
province: {
_id: number;
name: string;
createdAt: string;
updatedAt: string;
__v: number;
};
postalCode: string;
plaque: string;
lat: string;
lon: string;
createdAt: string;
name: string;
}>;
updatedAt: string;
__v: number;
};
isSeller: boolean;
};
}>;