From 97f7fa5113d98b510424abd82a869b6de31dd14a Mon Sep 17 00:00:00 2001 From: hamid zarghami Date: Tue, 24 Dec 2024 09:45:37 +0330 Subject: [PATCH] login and register --- .github/workflows/deploy.yaml | 48 +++++++++++++++++ src/index.css | 2 +- src/langs/fa.json | 7 ++- src/pages/auth/Login.tsx | 97 +++++++++++++---------------------- src/pages/auth/Register.tsx | 93 ++++++++++++++++++++++++++++++++- 5 files changed, 182 insertions(+), 65 deletions(-) create mode 100644 .github/workflows/deploy.yaml diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml new file mode 100644 index 0000000..63df803 --- /dev/null +++ b/.github/workflows/deploy.yaml @@ -0,0 +1,48 @@ +name: deploy to danak + +on: + push: + branches: + - master + +jobs: + build_and_deploy: + runs-on: ubuntu-latest + + env: + DANAK_SERVER: "https://captain.run.danakcorp.com" + APP_TOKEN: f0ced29da1a7c75252c607e6eebeb2459a70d32402d6077816688b06e5e2823b + CAPROVER_APP_NAME: danak-dsc + GITHUB_TOKEN: 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 + + steps: + - name: Check out repositorys + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: zmihamid + password: ${{ env.GITHUB_TOKEN }} + + - name: Preset Image Name + run: echo "IMAGE_URL=$(echo ghcr.io/zmihamid/${{ github.event.repository.name }}:$(echo ${{ github.sha }} | cut -c1-7) | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV + + - name: Build and push Docker Image + uses: docker/build-push-action@v5 + with: + context: . + file: ./Dockerfile + push: true + tags: ${{ env.IMAGE_URL }} + + - name: Install CapRover CLI + run: npm install -g caprover + + - name: deploy to server + run: | + caprover deploy -a $CAPROVER_APP_NAME -u $DANAK_SERVER --appToken $APP_TOKEN -i "$IMAGE_URL" diff --git a/src/index.css b/src/index.css index f2ad9f9..c3a3481 100644 --- a/src/index.css +++ b/src/index.css @@ -39,7 +39,7 @@ textarea::placeholder { min-height: 40px; border-radius: 12px !important; border: 1px solid #d0d0d0 !important; - font-size: 14px !important; + font-size: 12px !important; width: 100% !important; margin: 0px; padding-right: 16px !important; diff --git a/src/langs/fa.json b/src/langs/fa.json index 17f07f5..22d2270 100644 --- a/src/langs/fa.json +++ b/src/langs/fa.json @@ -19,6 +19,11 @@ "enter_password": "رمز عبور انتخابی خود را وارد کنید", "next": "ادامه", "before_registered": "آیا قبلا ثبت نام کردید؟", - "login": "ورود" + "login": "ورود", + "enter_info_login": "لطفا اطلاعات خود را وارد کنید.", + "mobile_or_email": " شماره موبایل یا ایمیل", + "enter_mobile_or_email": " شماره موبایل یا ایمیل خود را وارد کنید", + "have_account": "آیا حساب کاربری ندارید؟", + "register": "ثبت نام" } } diff --git a/src/pages/auth/Login.tsx b/src/pages/auth/Login.tsx index fae35b0..f812446 100644 --- a/src/pages/auth/Login.tsx +++ b/src/pages/auth/Login.tsx @@ -3,8 +3,9 @@ import LogoImage from '../../assets/images/logo.svg' import LogoSmallImage from '../../assets/images/logo-small.svg' import { useTranslation } from 'react-i18next' import Input from '../../components/Input' -import DatePickerComponent from '../../components/DatePicker' import Button from '../../components/Button' +import { Link } from 'react-router-dom' +import { Pages } from '../../config/Pages' const Login: FC = () => { @@ -13,74 +14,46 @@ const Login: FC = () => { return (
-
-
+
+
-
-

- {t('auth.welcome')} -

-

- {t('auth.enter_information')} -

-
- {/*
- {t('auth.user_info')} -
*/} +
+
+

+ {t('auth.welcome')} +

+

+ {t('auth.enter_info_login')} +

+
-
- - - - -
-
- console.log(date)} placeholder={t('auth.select_date')} /> - - + + +
+ + +
-
- - -
- -
- -
- -
diff --git a/src/pages/auth/Register.tsx b/src/pages/auth/Register.tsx index 51f1920..6eae68a 100644 --- a/src/pages/auth/Register.tsx +++ b/src/pages/auth/Register.tsx @@ -1,8 +1,99 @@ import { FC } from 'react' +import LogoImage from '../../assets/images/logo.svg' +import LogoSmallImage from '../../assets/images/logo-small.svg' +import { useTranslation } from 'react-i18next' +import Input from '../../components/Input' +import DatePickerComponent from '../../components/DatePicker' +import Button from '../../components/Button' +import { Link } from 'react-router-dom' +import { Pages } from '../../config/Pages' const Register: FC = () => { + + const { t } = useTranslation('global') + return ( -
Register
+
+
+
+
+ +
+

+ {t('auth.welcome')} +

+

+ {t('auth.enter_information')} +

+
+ + {/*
+ {t('auth.user_info')} +
*/} + +
+ + + + +
+
+ console.log(date)} placeholder={t('auth.select_date')} /> + + + +
+ +
+ + +
+ +
+ +
+ +
+
+ +
+ +
+
+
) }