From 19636230ba669fe9dbe1a6cdff03b1ad70165a6b Mon Sep 17 00:00:00 2001 From: hamid zarghami Date: Sat, 8 Feb 2025 14:20:50 +0330 Subject: [PATCH] payment --- .env | 4 +- src/components/ModalConfrim.tsx | 31 ++- src/components/Textarea.tsx | 11 +- src/config/Pages.ts | 3 + src/config/SideBarSubMenu.ts | 1 - src/config/func.ts | 4 + src/langs/fa.json | 28 ++- src/pages/payment/List.tsx | 178 +++++++++++++++++ src/pages/payment/components/Accept.tsx | 51 +++++ src/pages/payment/components/Reject.tsx | 56 ++++++ src/pages/payment/hooks/usePaymentData.ts | 30 +++ src/pages/payment/service/PaymentService.ts | 27 +++ src/pages/payment/types/PaymentTypes.ts | 57 ++++++ src/pages/transaction/List.tsx | 181 ++++++++---------- .../transaction/hooks/useTransactionData.ts | 14 ++ .../transaction/service/TransactionService.ts | 24 +++ .../transaction/types/TransactionTypes.ts | 7 + src/router/Main.tsx | 2 + src/shared/SideBar.tsx | 30 +-- 19 files changed, 612 insertions(+), 127 deletions(-) create mode 100644 src/pages/payment/List.tsx create mode 100644 src/pages/payment/components/Accept.tsx create mode 100644 src/pages/payment/components/Reject.tsx create mode 100644 src/pages/payment/hooks/usePaymentData.ts create mode 100644 src/pages/payment/service/PaymentService.ts create mode 100644 src/pages/payment/types/PaymentTypes.ts create mode 100644 src/pages/transaction/hooks/useTransactionData.ts create mode 100644 src/pages/transaction/service/TransactionService.ts create mode 100644 src/pages/transaction/types/TransactionTypes.ts diff --git a/.env b/.env index baf030d..e4cd019 100644 --- a/.env +++ b/.env @@ -1,4 +1,4 @@ VITE_TOKEN_NAME = 'admin_token' VITE_REFRESH_TOKEN_NAME = 'admin_refresh_token' -VITE_BASE_URL = 'https://danak-dsc-api.run.danakcorp.com' -# VITE_BASE_URL = 'http://192.168.0.221:4000' \ No newline at end of file +# VITE_BASE_URL = 'https://danak-dsc-api.run.danakcorp.com' +VITE_BASE_URL = 'http://192.168.0.245:4000' \ No newline at end of file diff --git a/src/components/ModalConfrim.tsx b/src/components/ModalConfrim.tsx index 769ac1f..ae92f28 100644 --- a/src/components/ModalConfrim.tsx +++ b/src/components/ModalConfrim.tsx @@ -1,18 +1,22 @@ -import { FC } from 'react' +import { FC, useState } from 'react' import DefaulModal from './DefaulModal' import { useTranslation } from 'react-i18next' import Button from './Button' +import Textarea from './Textarea' type Props = { isLoading?: boolean, close: () => void, isOpen: boolean, - onConfrim: () => void, + onConfrim: (text?: string) => void, + label?: string, + isHasDescription?: boolean } const ModalConfrim: FC = (props: Props) => { const { t } = useTranslation('global') + const [description, setDescription] = useState('') return ( = (props: Props) => { isHeader >
-
{t('confrim.content')}
+
+ { + props.label ? + props.label + : + t('confrim.content') + } + + { + props.isHasDescription && +
+