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 && +
+