|
|
|
|
|
|
|
|
RegisterDescription, |
|
|
RegisterDescription, |
|
|
} from "./FirstPartOfRegistration.styled"; |
|
|
} from "./FirstPartOfRegistration.styled"; |
|
|
import { useFormik } from "formik"; |
|
|
import { useFormik } from "formik"; |
|
|
import * as Yup from "yup"; |
|
|
|
|
|
|
|
|
// import * as Yup from "yup"; |
|
|
import { useTranslation } from "react-i18next"; |
|
|
import { useTranslation } from "react-i18next"; |
|
|
import { TextField } from "../../../../components/TextFields/TextField/TextField"; |
|
|
import { TextField } from "../../../../components/TextFields/TextField/TextField"; |
|
|
import { IconButton } from "../../../../components/Buttons/IconButton/IconButton"; |
|
|
import { IconButton } from "../../../../components/Buttons/IconButton/IconButton"; |
|
|
|
|
|
|
|
|
import { ReactComponent as VisibilityOff } from "../../../../assets/images/svg/eye-striked.svg"; |
|
|
import { ReactComponent as VisibilityOff } from "../../../../assets/images/svg/eye-striked.svg"; |
|
|
import { PrimaryButton } from "../../../../components/Buttons/PrimaryButton/PrimaryButton"; |
|
|
import { PrimaryButton } from "../../../../components/Buttons/PrimaryButton/PrimaryButton"; |
|
|
import selectedTheme from "../../../../themes"; |
|
|
import selectedTheme from "../../../../themes"; |
|
|
|
|
|
import firstPartValidation from "../../../../validations/registerValidations/firstPartValidation"; |
|
|
|
|
|
|
|
|
const FirstPartOfRegistration = (props) => { |
|
|
const FirstPartOfRegistration = (props) => { |
|
|
const [showPassword, setShowPassword] = useState(false); |
|
|
const [showPassword, setShowPassword] = useState(false); |
|
|
|
|
|
|
|
|
mail: "", |
|
|
mail: "", |
|
|
password: "", |
|
|
password: "", |
|
|
}, |
|
|
}, |
|
|
validationSchema: Yup.object().shape({ |
|
|
|
|
|
mail: Yup.string() |
|
|
|
|
|
.email(t("forgotPassword.emailFormat")) |
|
|
|
|
|
.required(t("login.usernameRequired")), |
|
|
|
|
|
password: Yup.string() |
|
|
|
|
|
.required(t("login.passwordRequired")) |
|
|
|
|
|
.min(8, t("login.passwordLength")), |
|
|
|
|
|
}), |
|
|
|
|
|
|
|
|
validationSchema: firstPartValidation, |
|
|
onSubmit: props.handleSubmit, |
|
|
onSubmit: props.handleSubmit, |
|
|
validateOnBlur: true, |
|
|
validateOnBlur: true, |
|
|
enableReinitialize: true, |
|
|
enableReinitialize: true, |