From 257b287dfd19db302be533b35a80064b2fbf010e Mon Sep 17 00:00:00 2001 From: hamid zarghami Date: Sun, 13 Jul 2025 13:19:06 +0330 Subject: [PATCH] address --- .env | 2 + index.html | 25 +- public/vite.svg | 4 +- src/App.tsx | 2 +- src/components/ModalConfrim.tsx | 69 +++++ src/langs/fa.json | 13 + src/pages/setting/address/Address.tsx | 290 ++++++++++++++---- .../setting/address/hooks/useAddressData.ts | 37 ++- src/pages/setting/address/service/Service.ts | 21 +- src/pages/setting/address/types/Types.ts | 21 ++ src/pages/setting/mail-server/MailServer.tsx | 106 ++++--- .../mail-server/hooks/useMailServerData.ts | 9 + .../setting/mail-server/service/Service.ts | 6 + 13 files changed, 491 insertions(+), 114 deletions(-) create mode 100644 src/components/ModalConfrim.tsx create mode 100644 src/pages/setting/mail-server/hooks/useMailServerData.ts create mode 100644 src/pages/setting/mail-server/service/Service.ts diff --git a/.env b/.env index 43d9218..55b7799 100644 --- a/.env +++ b/.env @@ -4,3 +4,5 @@ VITE_DANAK_BASE_URL ='https://api.danakcorp.com' # VITE_BASE_URL = 'http://192.168.1.134:4000' VITE_BASE_URL = 'https://dmail-api.danakcorp.com' VITE_SERVICE_ID = 'e51afdc3-ea0b-49cf-8f49-2a6f131b024e' + +VITE_LOGIN_URL = 'https://console.danakcorp.com/auth/login' diff --git a/index.html b/index.html index e4b78ea..430b830 100644 --- a/index.html +++ b/index.html @@ -1,13 +1,16 @@ - - - - - Vite + React + TS - - -
- - - + + + + + + Dmail Admin | داناک + + + +
+ + + + \ No newline at end of file diff --git a/public/vite.svg b/public/vite.svg index e7b8dfb..30a42c2 100644 --- a/public/vite.svg +++ b/public/vite.svg @@ -1 +1,3 @@ - \ No newline at end of file + + + diff --git a/src/App.tsx b/src/App.tsx index 323d264..f1650fa 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -81,7 +81,7 @@ const queryClient = new QueryClient({ // Clear tokens and redirect to login await removeToken(); await removeRefreshToken(); - window.location.href = '/auth/login'; + window.location.href = import.meta.env.VITE_LOGIN_URL; } } } diff --git a/src/components/ModalConfrim.tsx b/src/components/ModalConfrim.tsx new file mode 100644 index 0000000..f82ad46 --- /dev/null +++ b/src/components/ModalConfrim.tsx @@ -0,0 +1,69 @@ +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: (text?: string) => void, + label?: string, + isHasDescription?: boolean, + title?: string +} + +const ModalConfrim: FC = (props: Props) => { + + const { t } = useTranslation('global') + const [description, setDescription] = useState('') + + return ( + +
+
+ { + props.label ? + props.label + : + t('confrim.content') + } + + { + props.isHasDescription && +
+