This commit is contained in:
hamid zarghami
2025-02-23 15:43:04 +03:30
parent 5916ab100d
commit bc3d068dfd
24 changed files with 278 additions and 121 deletions
+29 -8
View File
@@ -10,6 +10,8 @@ import { useSharedStore } from './store/sharedStore'
import { useGetProfile } from '../pages/profile/hooks/useProfileData'
import { Popover, PopoverButton, PopoverPanel } from '@headlessui/react'
import SideBarItem from './SideBarItem'
import { useGetWalletBalance } from '../pages/wallet/hooks/useWalletData'
import { NumberFormat } from '../config/func'
const Header: FC = () => {
@@ -18,6 +20,7 @@ const Header: FC = () => {
const { t } = useTranslation('global')
const { setOpenSidebar, openSidebar } = useSharedStore()
const { data } = useGetProfile()
const getWalletBalance = useGetWalletBalance()
useEffect(() => {
setPopoverKey((prevKey) => prevKey + 1);
@@ -40,9 +43,19 @@ const Header: FC = () => {
<Link to={Pages.services.other}>
<Element3 color='black' className='xl:size-[18px] size-[17px]' />
</Link>
<Link to={Pages.wallet}>
<Link className='xl:hidden' to={Pages.wallet}>
<Wallet className='xl:size-[18px] size-[17px]' color='black' />
</Link>
<Link className='hidden xl:block' to={Pages.wallet}>
<div className='flex items-center h-8 pl-2 rounded-full bg-[#EEF0F7]'>
<div className='px-3 text-xs'>
{NumberFormat(getWalletBalance.data?.data?.balance) + ' ' + t('toman')}
</div>
<div className='size-[26px] flex justify-center items-center bg-white rounded-xl'>
<Wallet className='xl:size-[18px] size-[17px]' color='black' />
</div>
</div>
</Link>
<Notifications />
{
data && (
@@ -80,13 +93,21 @@ const Header: FC = () => {
</div>
<div className='pb-6 px-6 border-b border-[#EAEDF5]'>
<SideBarItem
icon={<Wallet size={20} color='black' />}
title={t('header.wallet')}
link={Pages.wallet}
isActive
isWithoutLine
/>
<div className='flex justify-between items-center'>
<SideBarItem
icon={<Wallet size={20} color='black' />}
title={t('header.wallet')}
link={Pages.wallet}
isActive
isWithoutLine
/>
<div className='flex items-center mt-4 h-8 pl-2 rounded-full bg-[#EEF0F7]'>
<div className='ps-3'>{t('home.balance')}</div>
<div className='px-3 text-xs'>
{NumberFormat(getWalletBalance.data?.data?.balance) + ' ' + t('toman')}
</div>
</div>
</div>
<SideBarItem
icon={<Card color={'black'} size={20} />}