From 7bc3e2ccb54a26d09b56c565e2f7744b09987a60 Mon Sep 17 00:00:00 2001 From: Alibek Date: Tue, 12 Mar 2024 04:04:41 +0600 Subject: [PATCH] added policy checkbox in sign-up form, fixed height bug in sign-up page --- src/shared/ui/auth-classes.scss | 1 - src/widgets/forms/SignUpForm/SignUpForm.scss | 36 ++++++++++++++++++++ src/widgets/forms/SignUpForm/SignUpForm.tsx | 26 +++++++++++++- src/widgets/forms/SignUpForm/icons/check.svg | 7 ++++ 4 files changed, 68 insertions(+), 2 deletions(-) create mode 100644 src/widgets/forms/SignUpForm/icons/check.svg diff --git a/src/shared/ui/auth-classes.scss b/src/shared/ui/auth-classes.scss index 7862a38..7ac3283 100644 --- a/src/shared/ui/auth-classes.scss +++ b/src/shared/ui/auth-classes.scss @@ -90,7 +90,6 @@ @media screen and (max-width: 550px) { .auth-page { padding: 48px 16px; - min-height: 600px; } .auth-wrapper { diff --git a/src/widgets/forms/SignUpForm/SignUpForm.scss b/src/widgets/forms/SignUpForm/SignUpForm.scss index bfb6c3c..a12d87e 100644 --- a/src/widgets/forms/SignUpForm/SignUpForm.scss +++ b/src/widgets/forms/SignUpForm/SignUpForm.scss @@ -6,6 +6,42 @@ display: flex; flex-direction: column; + &__policy { + margin-top: 30px; + display: flex; + align-items: center; + gap: 12px; + + p, + a { + font-size: 14px; + font-weight: 500; + line-height: 20px; + } + + p { + color: #344054; + } + + a { + color: #0077b6; + } + } + + &__checkbox { + width: 16px; + height: 16px; + display: flex; + align-items: center; + justify-content: center; + border: 1px solid #d0d5dd; + border-radius: 4px; + img { + width: 10px; + height: 10px; + } + } + &__error { font-size: 14px; font-weight: 400; diff --git a/src/widgets/forms/SignUpForm/SignUpForm.tsx b/src/widgets/forms/SignUpForm/SignUpForm.tsx index d4ef92b..925355e 100644 --- a/src/widgets/forms/SignUpForm/SignUpForm.tsx +++ b/src/widgets/forms/SignUpForm/SignUpForm.tsx @@ -7,9 +7,12 @@ import Loader from "@/shared/ui/components/Loader/Loader"; import GoogleButton from "@/features/GoogleButton/GoogleButton"; import { apiInstance } from "@/shared/config/apiConfig"; import { AxiosError } from "axios"; -import { useRouter } from "@/shared/config/navigation"; +import { Link, useRouter } from "@/shared/config/navigation"; +import check from "./icons/check.svg"; +import Image from "next/image"; const SignUpForm = () => { + const [checkbox, setCheckbox] = useState(false); const [emailWarning, setEmailWarning] = useState(""); const [passwordWarning, setPasswordWarning] = useState(""); const [passwordConfirmWarning, setPasswordConfirmWarning] = @@ -81,6 +84,14 @@ const SignUpForm = () => { return; } + if (!checkbox) { + setEmailWarning(""); + setPasswordWarning(""); + setPasswordConfirmWarning(""); + setError("Необходимо принять политику конфиденциальности"); + return; + } + try { setError(""); setEmailWarning(""); @@ -141,6 +152,19 @@ const SignUpForm = () => { /> {error ?

{error}

: null} +
+ +

+ Я ознакомлен(-а) с{" "} + Политикой конфиденциальности +

+