forked from Transparency/kgroad-frontend2
added policy checkbox in sign-up form, fixed height bug in sign-up page
This commit is contained in:
1 parent
74b15060a1
commit
7bc3e2ccb5
4 files changed
+68
-2
No files matched your search
@@ -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<boolean>(false);
|
||||
const [emailWarning, setEmailWarning] = useState<string>("");
|
||||
const [passwordWarning, setPasswordWarning] = useState<string>("");
|
||||
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 = () => {
|
||||
/>
|
||||
</div>
|
||||
{error ? <p className="sign-up-form__error">{error}</p> : null}
|
||||
<div className="sign-up-form__policy">
|
||||
<button
|
||||
onClick={() => setCheckbox((prev) => !prev)}
|
||||
type="button"
|
||||
className="sign-up-form__checkbox"
|
||||
>
|
||||
{checkbox ? <Image src={check} alt="Check Icon" /> : null}
|
||||
</button>
|
||||
<p>
|
||||
Я ознакомлен(-а) с{" "}
|
||||
<Link href="#">Политикой конфиденциальности</Link>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div className="sign-up-form__btns">
|
||||
<button className="sign-up-form__btns_first" type="submit">
|
||||
|
||||
Reference in new issue
Block a user