receip + active or in active service + ...

This commit is contained in:
hamid zarghami
2025-03-01 17:26:26 +03:30
parent 86ff12ec0c
commit 1012ea7544
8 changed files with 35 additions and 18 deletions
+1 -1
View File
@@ -38,7 +38,7 @@ const queryClient = new QueryClient({
defaultOptions: {
queries: {
refetchOnWindowFocus: false,
staleTime: 86400000 // 1 day in milliseconds
// staleTime: 86400000 // 1 day in milliseconds
},
},
});
+1 -1
View File
@@ -2,7 +2,7 @@ import { FC } from 'react'
import { ItemServiceType } from '../pages/service/types/ServiecTypes'
type Props = {
item: ItemServiceType
item: ItemServiceType,
}
const ServiceSection: FC<Props> = (props: Props) => {
+4 -2
View File
@@ -233,13 +233,13 @@
"date_receipt": "تاریخ صورتحساب",
"last_date_receipt": "آخرین مهلت پرداخت",
"service": "سرویس",
"status": "وضعیت تایید",
"status": "وضعیت ",
"status_paid": "وضعیت پرداخت",
"PENDING": "در انتظار ",
"PAID": "پرداخت شده",
"CANCELED": "لغو شده",
"EXPIRED": "منقضی شده",
"APPROVED": "تایید شده",
"WAIT_PAYMENT": "در انتظار پرداخت",
"real_person": "شخص حقیقی",
"fullName": "نام و نام خانوادگی",
"compelete_financal_info_error": "برای دریافت فاکتور رسمی اطلاعات مالی خود را وارد کنید",
@@ -256,6 +256,8 @@
"apply": "اعمال",
"pending": "تایید نشده"
},
"active": "فعال",
"inactive": "غیرفعال",
"confrim": {
"subject": "حذف",
"content": "برای حذف این آیتم مطمئن هستید؟",
+9 -6
View File
@@ -139,17 +139,20 @@ const ReceiptsDetail: FC = () => {
</div>
<div className='bg-white xl:w-sidebar text-sm h-fit rounded-3xl p-8'>
<div className='p-6 bg-green-50 rounded-2xl text-green-400 text-xs mb-6'>
<p>{t('receip.thank_pay_1')}</p>
<p className='mt-1'>{t('receip.thank_pay_2')}</p>
</div>
{
getInvoce.data?.data?.invoice?.status === 'PAID' &&
<div className='p-6 bg-green-50 rounded-2xl text-green-400 text-xs mb-6'>
<p>{t('receip.thank_pay_1')}</p>
<p className='mt-1'>{t('receip.thank_pay_2')}</p>
</div>
}
<div className='flex justify-between items-center'>
<div>
{t('receip.receip_information')}
</div>
<div className={clx(
'border border-orange-400 text-orange-400 rounded-lg text-[9px] h-6 flex items-center px-1',
getInvoce.data?.data?.invoice?.status === 'PAID' || getInvoce.data?.data?.invoice?.status === 'APPROVED' ? 'border-green-400 text-green-400' : getInvoce.data?.data?.invoice?.status !== 'PENDING' ? 'border-red-400 text-red-400' : 'border-orange-400 text-orange-400'
getInvoce.data?.data?.invoice?.status === 'PAID' ? 'border-green-400 text-green-400' : getInvoce.data?.data?.invoice?.status !== 'PENDING' ? 'border-red-400 text-red-400' : 'border-orange-400 text-orange-400'
)}>
<div>{t(`receip.${getInvoce.data?.data?.invoice?.status}`)}</div>
</div>
@@ -190,7 +193,7 @@ const ReceiptsDetail: FC = () => {
</div>
{
getInvoce.data?.data?.invoice?.status === 'APPROVED' &&
getInvoce.data?.data?.invoice?.status === 'WAIT_PAYMENT' &&
<div className='flex gap-4 items-center mt-8'>
<Button
label={t('receip.get_factor')}
+1 -1
View File
@@ -115,7 +115,7 @@ const ReceiptsList: FC = () => {
</div>
</Td>
<Td text={t(`receip.${item.status}`)} />
<Td text={item.paidAt ? t('receip.paid') : t('receip.not_paid')} />
<Td text={item.status === 'PAID' ? moment(item.paidAt).format('jYYYY-jMM-jDD') : t('receip.not_paid')} />
<Td text={''}>
<Link to={Pages.receipts.detail + item.id}>
<Eye size={20} color='black' />
@@ -54,7 +54,7 @@ const ApproveInvoice: FC<Props> = ({ id, refetch, status }) => {
})
}
if (status === 'PENDING' || status === 'APPROVED' && getProfile.isSuccess)
if (status === 'PENDING' || status === 'WAIT_PAYMENT' && getProfile.isSuccess)
return (
<Fragment>
<Button
@@ -62,7 +62,7 @@ const ApproveInvoice: FC<Props> = ({ id, refetch, status }) => {
onClick={() => status === 'PENDING' ? handleShowModal() : null}
className={clx(
'px-9 w-fit bg-white bg-opacity-70 text-description',
status === 'APPROVED' && 'bg-green-300 text-[#00BA4B] bg-opacity-10'
status === 'WAIT_PAYMENT' && 'bg-green-300 text-[#00BA4B] bg-opacity-10'
)}
>
<div className='flex gap-2.5'>
@@ -72,7 +72,7 @@ const ApproveInvoice: FC<Props> = ({ id, refetch, status }) => {
/>
<div className='whitespace-nowrap'>
{
status === 'APPROVED' ?
status === 'WAIT_PAYMENT' ?
t('receip.accepted')
:
t('receip.confrim_factor')
+15 -4
View File
@@ -11,6 +11,7 @@ import { useGetAds } from '../ads/hooks/useAdsData'
import { AdsDisplayLocation } from '../ads/types/AdsTypes'
import { Helmet } from 'react-helmet-async'
import ServiceItemSkeleton from './components/ServiceItemSkeleton'
import { clx } from '../../helpers/utils'
const MyServices: FC = () => {
@@ -60,7 +61,10 @@ const MyServices: FC = () => {
:
getServices.data?.data?.subscriptions?.map((item: MyServicesItem) => {
return (
<Link key={item.id} to={Pages.services.detail + item.id} className='flex-1 min-w-[40%] xl:min-w-[20%] bg-white rounded-3xl p-6'>
<Link key={item.id} to={item.status === 'ACTIVE' ? Pages.services.detail + item.id : ''} className={clx(
'flex-1 min-w-[40%] xl:min-w-[20%] bg-white rounded-3xl p-6',
item.status === 'INACTIVE' && 'opacity-50'
)}>
<ServiceSection
item={{
author: item.plan.service.author,
@@ -77,14 +81,21 @@ const MyServices: FC = () => {
serviceLanguage: item.plan.service.serviceLanguage,
softwareLanguage: item.plan.service.softwareLanguage,
updatedAt: item.plan.service.updatedAt,
userCount: item.plan.service?.userCount
userCount: item.plan.service?.userCount,
}}
/>
<div className='mt-6 flex gap-1 items-center'>
<StatusCircle
color='#00BA4B'
color={item.status === 'ACTIVE' ? '#00BA4B' : '#FF0000'}
/>
<div className='text-xs text-description'>1 {t('service.active_menu')}</div>
<div className='text-xs text-description'>
{
item.status === 'ACTIVE' ?
t('active')
:
t('inactive')
}
</div>
</div>
</Link>
+1
View File
@@ -85,6 +85,7 @@ export type MyServicesItem = {
createdAt: string;
duration: number;
isActive: boolean;
status: "ACTIVE" | "INACTIVE";
name: string;
price: number;
service: {