import React, { useState } from "react"; import { Navigate } from "react-router-dom"; import { useFormValidation } from "@hooks/useFormValidation"; import { useNotification } from "@hooks/useNotification"; import { AuthHeader } from "@components/Common/AuthHeader/AuthHeader"; import BaseButton from "@components/Common/BaseButton/BaseButton"; import { Footer } from "@components/Common/Footer/Footer"; import { Loader } from "@components/Common/Loader/Loader"; import ModalLayout from "@components/Common/ModalLayout/ModalLayout"; import { ModalTrackerRegistration } from "@components/Modal/ModalTrackerRegistration/ModalTrackerRegistration"; import SideBar from "@components/SideBar/SideBar"; import arrowInfo from "assets/icons/trackerIntroInfo.svg"; import authImg from "assets/images/partnerProfile/authCandidateFormImg.png"; import registrationImg from "assets/images/trackerRegistrationImg.png"; import "./trackerRegistration.scss"; export const TrackerRegistration = () => { const [modalConfirmOpen, setModalConfirm] = useState(false); const [loader, setLoader] = useState(false); const [isPartner, setIsPartner] = useState(false); const fields = { username: "", email: "", password: "", secondPassword: "" }; const apiEndpoint = "/register/sign-up"; const { showNotification } = useNotification(); const showNotificationError = (error) => { showNotification({ show: true, text: error, type: "error" }); }; const showNotificationTrue = () => { showNotification({ show: true, text: "Аккаунт успешно создан", type: "success" }); }; const { formData, validationErrors, handleChange, handleSubmit } = useFormValidation( apiEndpoint, fields, showNotificationError, showNotificationTrue, isPartner, setLoader ); return (

Создайте свое{" "} рабочее пространство arrow

Ваше имя
{validationErrors.username}
Ваш e-mail
{validationErrors.email}
Придумайте пароль
{validationErrors.password}
Повторите пароль
{validationErrors.secondPassword}
{loader ? ( ) : ( { e.preventDefault(); await handleSubmit(e); }} styles="button-box__submit" > Отправить )}
img

Создавайте и редактируйте задачи и проекты вместе с другими участниками команды.

img
{modalConfirmOpen && ( )}
); };