empty page
This commit is contained in:
@@ -61,7 +61,6 @@ const queryClient = new QueryClient({
|
||||
try {
|
||||
const refreshTokenValue = await getRefreshToken();
|
||||
const { data } = await refreshToken({ refreshToken: refreshTokenValue || '' });
|
||||
console.log('data', data);
|
||||
|
||||
if (data?.accessToken?.token) {
|
||||
// Save the new token
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 6.2 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 9.8 KiB |
@@ -463,5 +463,11 @@
|
||||
"status": "وضعیت",
|
||||
"active": "فعال",
|
||||
"deactive": "غیرفعال"
|
||||
},
|
||||
"empty": {
|
||||
"empty_my_service": "سرویسی یافت نشد.",
|
||||
"add_service": "افزودن سرویس",
|
||||
"empty_discount": "تخفیفی یافت نشد.",
|
||||
"my_services": "سرویس های من"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import Td from '../../components/Td'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { DiscountItemType } from './types/DiscountTypes'
|
||||
import moment from 'moment-jalaali'
|
||||
import EmptyDiscount from './components/EmptyDiscount'
|
||||
|
||||
const MyDiscountList: FC = () => {
|
||||
|
||||
@@ -17,42 +18,46 @@ const MyDiscountList: FC = () => {
|
||||
getDiscounts.isPending ?
|
||||
<PageLoading />
|
||||
:
|
||||
<div className='relative overflow-x-auto rounded-3xl mt-9 w-full'>
|
||||
<table className='w-full text-sm '>
|
||||
<thead className='thead'>
|
||||
<tr>
|
||||
<Td text={t('discount.number')} />
|
||||
<Td text={t('discount.type')} />
|
||||
<Td text={t('discount.code')} />
|
||||
<Td text={t('discount.start_date')} />
|
||||
<Td text={t('discount.end_date')} />
|
||||
<Td text={t('discount.percent_ammount')} />
|
||||
<Td text={t('discount.service')} />
|
||||
<Td text={t('discount.status')} />
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{
|
||||
getDiscounts.data?.data?.discounts?.map((item: DiscountItemType, index: number) => {
|
||||
return (
|
||||
<tr key={item.id} className='tr'>
|
||||
<Td text={String(index + 1)} />
|
||||
<Td text={t(`discount.${item.type}`)} />
|
||||
<Td text={item.code} />
|
||||
<Td text={moment(item.startDate).format('jYYYY-jMM-jDD')} />
|
||||
<Td text={moment(item.endDate).format('jYYYY-jMM-jDD')} />
|
||||
<Td text={item.type === 'CODE' ? item.amount + '%' : item.amount + 'تومان'} />
|
||||
<Td text={item.subscriptionPlans[0]?.service?.name} />
|
||||
<Td text={''}>
|
||||
{item.isActive ? <span className='text-green-400'>{t('discount.active')}</span> : <span className='text-gray-500'>{t('discount.inactive')}</span>}
|
||||
</Td>
|
||||
</tr>
|
||||
)
|
||||
})
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
getDiscounts.data?.data?.discounts?.length > 0 ?
|
||||
<div className='relative overflow-x-auto rounded-3xl mt-9 w-full'>
|
||||
<table className='w-full text-sm '>
|
||||
<thead className='thead'>
|
||||
<tr>
|
||||
<Td text={t('discount.number')} />
|
||||
<Td text={t('discount.type')} />
|
||||
<Td text={t('discount.code')} />
|
||||
<Td text={t('discount.start_date')} />
|
||||
<Td text={t('discount.end_date')} />
|
||||
<Td text={t('discount.percent_ammount')} />
|
||||
<Td text={t('discount.service')} />
|
||||
<Td text={t('discount.status')} />
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{
|
||||
|
||||
getDiscounts.data?.data?.discounts?.map((item: DiscountItemType, index: number) => {
|
||||
return (
|
||||
<tr key={item.id} className='tr'>
|
||||
<Td text={String(index + 1)} />
|
||||
<Td text={t(`discount.${item.type}`)} />
|
||||
<Td text={item.code} />
|
||||
<Td text={moment(item.startDate).format('jYYYY-jMM-jDD')} />
|
||||
<Td text={moment(item.endDate).format('jYYYY-jMM-jDD')} />
|
||||
<Td text={item.type === 'CODE' ? item.amount + '%' : item.amount + 'تومان'} />
|
||||
<Td text={item.subscriptionPlans[0]?.service?.name} />
|
||||
<Td text={''}>
|
||||
{item.isActive ? <span className='text-green-400'>{t('discount.active')}</span> : <span className='text-gray-500'>{t('discount.inactive')}</span>}
|
||||
</Td>
|
||||
</tr>
|
||||
)
|
||||
})
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
:
|
||||
<EmptyDiscount />
|
||||
}
|
||||
</div>
|
||||
)
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
import { FC } from 'react'
|
||||
import empty from '../../../assets/images/discount_empty_icon.png'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import Button from '../../../components/Button'
|
||||
import { Add } from 'iconsax-react'
|
||||
import { Link } from 'react-router-dom'
|
||||
import { Pages } from '../../../config/Pages'
|
||||
|
||||
const EmptyDiscount: FC = () => {
|
||||
const { t } = useTranslation('global')
|
||||
return (
|
||||
<div className='bg-white xl:p-8 p-4 rounded-3xl w-full'>
|
||||
<div className='flex flex-col items-center justify-center'>
|
||||
<img src={empty} alt='empty' className='w-[85px]' />
|
||||
<div className='mt-6 text-xs'>
|
||||
{t('empty.empty_discount')}
|
||||
</div>
|
||||
<Link to={Pages.services.mine} className='mt-6'>
|
||||
<Button
|
||||
className='w-full px-4'
|
||||
>
|
||||
<div className='flex items-center gap-2'>
|
||||
<Add size={20} color='white' />
|
||||
{t('empty.my_services')}
|
||||
</div>
|
||||
</Button>
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default EmptyDiscount
|
||||
@@ -8,6 +8,7 @@ import { AdsDisplayLocation } from '../ads/types/AdsTypes'
|
||||
import { Helmet } from 'react-helmet-async'
|
||||
import ServiceItemSkeleton from './components/ServiceItemSkeleton'
|
||||
import ServiceItem from '../../components/ServiceItem'
|
||||
import EmptyMyService from './components/EmptyMyService'
|
||||
|
||||
const MyServices: FC = () => {
|
||||
|
||||
@@ -55,17 +56,20 @@ const MyServices: FC = () => {
|
||||
getServices.isPending ?
|
||||
Array.from({ length: 4 }).map((_, index) => <ServiceItemSkeleton key={index} />)
|
||||
:
|
||||
getServices.data?.data?.subscriptions?.map((item: MyServicesItem) => {
|
||||
return (
|
||||
<ServiceItem
|
||||
key={item.id}
|
||||
item={item.plan.service}
|
||||
isLinkPanel
|
||||
businessName={item.businessName}
|
||||
isDisabled={item.status === 'INACTIVE'}
|
||||
/>
|
||||
)
|
||||
})
|
||||
getServices.data?.data?.subscriptions?.length > 0 ?
|
||||
getServices.data?.data?.subscriptions?.map((item: MyServicesItem) => {
|
||||
return (
|
||||
<ServiceItem
|
||||
key={item.id}
|
||||
item={item.plan.service}
|
||||
isLinkPanel
|
||||
businessName={item.businessName}
|
||||
isDisabled={item.status === 'INACTIVE'}
|
||||
/>
|
||||
)
|
||||
})
|
||||
:
|
||||
<EmptyMyService />
|
||||
}
|
||||
<div className='flex-1 min-w-[40%] xl:min-w-[20%] px-6'></div>
|
||||
<div className='flex-1 min-w-[40%] xl:min-w-[20%] px-6'></div>
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
import { FC } from 'react'
|
||||
import empty from '../../../assets/images/myservices_empty_icon.png'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import Button from '../../../components/Button'
|
||||
import { Add } from 'iconsax-react'
|
||||
import { Link } from 'react-router-dom'
|
||||
import { Pages } from '../../../config/Pages'
|
||||
|
||||
const EmptyMyService: FC = () => {
|
||||
const { t } = useTranslation('global')
|
||||
return (
|
||||
<div className='bg-white xl:p-8 p-4 rounded-3xl w-full'>
|
||||
<div className='flex flex-col items-center justify-center'>
|
||||
<img src={empty} alt='empty' className='w-[85px]' />
|
||||
<div className='mt-6 text-xs'>
|
||||
{t('empty.empty_my_service')}
|
||||
</div>
|
||||
<Link to={Pages.services.other} className='mt-6'>
|
||||
<Button
|
||||
className='w-full px-4'
|
||||
>
|
||||
<div className='flex items-center gap-2'>
|
||||
<Add size={20} color='white' />
|
||||
{t('empty.add_service')}
|
||||
</div>
|
||||
</Button>
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default EmptyMyService
|
||||
Reference in New Issue
Block a user