annoncement
This commit is contained in:
+1
-1
@@ -237,7 +237,7 @@
|
||||
"service": "سرویس",
|
||||
"status": "وضعیت ",
|
||||
"status_paid": "وضعیت پرداخت",
|
||||
"PENDING": "در انتظار ",
|
||||
"PENDING": "در انتظار تایید ",
|
||||
"PAID": "پرداخت شده",
|
||||
"CANCELED": "لغو شده",
|
||||
"EXPIRED": "منقضی شده",
|
||||
|
||||
@@ -21,7 +21,7 @@ const AnnouncementtList: FC = () => {
|
||||
|
||||
const handleChange = (item: AnnoncementItemType) => {
|
||||
if (window.innerWidth < 1280) {
|
||||
navigate(Pages.announcement.detail + item.id)
|
||||
navigate(Pages.announcement.detail + item.announcement.id)
|
||||
} else {
|
||||
setItemSelected(item)
|
||||
}
|
||||
@@ -79,29 +79,32 @@ const AnnouncementtList: FC = () => {
|
||||
)}>
|
||||
<div className='flex justify-between'>
|
||||
<div className='leading-6 text-xs xl:text-[12.5px] max-w-[70%]'>
|
||||
{item.title}
|
||||
{item.announcement.title}
|
||||
</div>
|
||||
|
||||
<div className='flex gap-1'>
|
||||
{
|
||||
item.isImportant &&
|
||||
item.announcement.isImportant &&
|
||||
<StatusWithText
|
||||
variant='error'
|
||||
text={t('announcement.important')}
|
||||
/>
|
||||
}
|
||||
{/* <StatusWithText
|
||||
{
|
||||
!item.isRead &&
|
||||
<StatusWithText
|
||||
variant='success'
|
||||
text={t('announcement.new')}
|
||||
/> */}
|
||||
/>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className='m-2 flex justify-between items-center text-[11px]'>
|
||||
<div dangerouslySetInnerHTML={{ __html: item.content }} className='max-w-[70%] truncate text-description'>
|
||||
<div dangerouslySetInnerHTML={{ __html: item.announcement.content }} className='max-w-[70%] truncate text-description'>
|
||||
</div>
|
||||
<div className='text-description'>
|
||||
{moment(item.publishAt, 'jYYYY/jMM/jDD').format('jYYYY/jMM/jDD')}
|
||||
{moment(item.announcement.publishAt).format('jYYYY/jMM/jDD')}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -122,7 +125,7 @@ const AnnouncementtList: FC = () => {
|
||||
متن اطلاعیه
|
||||
</div>
|
||||
{
|
||||
itemSelected.isImportant &&
|
||||
itemSelected.announcement.isImportant &&
|
||||
<StatusWithText
|
||||
variant='error'
|
||||
text={t('announcement.important')}
|
||||
@@ -131,10 +134,10 @@ const AnnouncementtList: FC = () => {
|
||||
</div>
|
||||
|
||||
<div className='mt-8'>
|
||||
{itemSelected.title}
|
||||
{itemSelected.announcement.title}
|
||||
</div>
|
||||
|
||||
<div dangerouslySetInnerHTML={{ __html: itemSelected.content }} className='mt-5 leading-7 text-xs font-light'>
|
||||
<div dangerouslySetInnerHTML={{ __html: itemSelected.announcement.content }} className='mt-5 leading-7 text-xs font-light'>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,16 +1,18 @@
|
||||
export type AnnoncementItemType = {
|
||||
content: string;
|
||||
createdAt: string;
|
||||
id: string;
|
||||
isImportant: boolean;
|
||||
isPublic: boolean;
|
||||
isRead: boolean;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
announcement: {
|
||||
id: string;
|
||||
createdAt: string;
|
||||
title: string;
|
||||
content: string;
|
||||
publishAt: string;
|
||||
service: {
|
||||
targetService: {
|
||||
id: string;
|
||||
name: string;
|
||||
};
|
||||
targetGroups: any[];
|
||||
title: string;
|
||||
updatedAt: string;
|
||||
isImportant: boolean;
|
||||
};
|
||||
isRead: boolean;
|
||||
};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useMutation, useQuery } from "@tanstack/react-query";
|
||||
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
||||
import * as api from "../service/ReceiptService";
|
||||
import {
|
||||
ApplyDiscountType,
|
||||
@@ -29,8 +29,14 @@ export const useApproveInvoice = () => {
|
||||
};
|
||||
|
||||
export const usePayInvoice = () => {
|
||||
const queryClient = useQueryClient();
|
||||
return useMutation({
|
||||
mutationFn: (variables: string) => api.payInvoice(variables),
|
||||
onSuccess: () => {
|
||||
queryClient.refetchQueries({
|
||||
queryKey: ["wallet-balance"],
|
||||
});
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user