debug ModalRegistration and
RegistrationForCandidate
This commit is contained in:
@ -17,7 +17,7 @@ export const RegistrationForCandidate = () => {
|
||||
const apiEndpoint = "/register/sign-up";
|
||||
|
||||
const fields = {
|
||||
name: "",
|
||||
username: "",
|
||||
summary: "",
|
||||
email: "",
|
||||
tg: "",
|
||||
@ -41,12 +41,13 @@ export const RegistrationForCandidate = () => {
|
||||
});
|
||||
};
|
||||
|
||||
const form = useFormValidation(
|
||||
apiEndpoint,
|
||||
fields,
|
||||
showNotificationError,
|
||||
showNotificationTrue
|
||||
);
|
||||
const { formData, validationErrors, handleChange, handleSubmit } =
|
||||
useFormValidation(
|
||||
apiEndpoint,
|
||||
fields,
|
||||
showNotificationError,
|
||||
showNotificationTrue
|
||||
);
|
||||
|
||||
return (
|
||||
<div className="registrationCandidate">
|
||||
@ -79,81 +80,79 @@ export const RegistrationForCandidate = () => {
|
||||
{/* форма регистрации */}
|
||||
<form
|
||||
className="registrationCandidate__form"
|
||||
onSubmit={form.handleSubmit}
|
||||
onSubmit={handleSubmit}
|
||||
>
|
||||
<div className="registrationCandidate__form__input">
|
||||
<label htmlFor="name">Ваше имя</label>
|
||||
<input
|
||||
className={form.validationErrors.name ? "error" : ""}
|
||||
value={form.formData.name}
|
||||
onChange={form.handleChange}
|
||||
id="name"
|
||||
className={validationErrors.username ? "error" : ""}
|
||||
value={formData.username}
|
||||
onChange={handleChange}
|
||||
id="username"
|
||||
type="text"
|
||||
placeholder="Имя"
|
||||
/>
|
||||
<span>{form.validationErrors.name}</span>
|
||||
<span>{validationErrors.username}</span>
|
||||
</div>
|
||||
<div className="registrationCandidate__form__input">
|
||||
<label htmlFor="summary">Если есть ссылка на резюме</label>
|
||||
<input
|
||||
className={form.validationErrors.summary ? "error" : ""}
|
||||
value={form.formData.summary}
|
||||
onChange={form.handleChange}
|
||||
className={validationErrors.summary ? "error" : ""}
|
||||
value={formData.summary}
|
||||
onChange={handleChange}
|
||||
id="summary"
|
||||
type="url"
|
||||
placeholder="Резюме"
|
||||
/>
|
||||
<span>{form.validationErrors.summary}</span>
|
||||
<span>{validationErrors.summary}</span>
|
||||
</div>
|
||||
<div className="registrationCandidate__form__input">
|
||||
<label htmlFor="email">Ваш e-mail</label>
|
||||
<input
|
||||
className={form.validationErrors.email ? "error" : ""}
|
||||
value={form.formData.email}
|
||||
onChange={form.handleChange}
|
||||
className={validationErrors.email ? "error" : ""}
|
||||
value={formData.email}
|
||||
onChange={handleChange}
|
||||
id="email"
|
||||
type="email"
|
||||
placeholder="E-mail"
|
||||
/>
|
||||
<span>{form.validationErrors.email}</span>
|
||||
<span>{validationErrors.email}</span>
|
||||
</div>
|
||||
<div className="registrationCandidate__form__input">
|
||||
<label htmlFor="tg">Ваш telegram</label>
|
||||
<input
|
||||
className={form.validationErrors.tg ? "error" : ""}
|
||||
value={form.formData.tg}
|
||||
onChange={form.handleChange}
|
||||
className={validationErrors.tg ? "error" : ""}
|
||||
value={formData.tg}
|
||||
onChange={handleChange}
|
||||
id="tg"
|
||||
type="text"
|
||||
placeholder="Telegram"
|
||||
/>
|
||||
<span>{form.validationErrors.tg}</span>
|
||||
<span>{validationErrors.tg}</span>
|
||||
</div>
|
||||
<div className="registrationCandidate__form__input">
|
||||
<label htmlFor="password">Придумайте пароль</label>
|
||||
<input
|
||||
className={form.validationErrors.password ? "error" : ""}
|
||||
value={form.formData.password}
|
||||
onChange={form.handleChange}
|
||||
className={validationErrors.password ? "error" : ""}
|
||||
value={formData.password}
|
||||
onChange={handleChange}
|
||||
id="password"
|
||||
type="password"
|
||||
placeholder="Пароль"
|
||||
/>
|
||||
<span>{form.validationErrors.password}</span>
|
||||
<span>{validationErrors.password}</span>
|
||||
</div>
|
||||
<div className="registrationCandidate__form__input">
|
||||
<label htmlFor="secondPassword">Повторите пароль</label>
|
||||
<input
|
||||
className={
|
||||
form.validationErrors.secondPassword ? "error" : ""
|
||||
}
|
||||
value={form.formData.secondPassword}
|
||||
onChange={form.handleChange}
|
||||
className={validationErrors.secondPassword ? "error" : ""}
|
||||
value={formData.secondPassword}
|
||||
onChange={handleChange}
|
||||
id="secondPassword"
|
||||
type="password"
|
||||
placeholder="Пароль"
|
||||
/>
|
||||
<span>{form.validationErrors.secondPassword}</span>
|
||||
<span>{validationErrors.secondPassword}</span>
|
||||
</div>
|
||||
<div className="registrationCandidate__form__submit">
|
||||
<button type="submit">Отправить</button>
|
||||
|
Reference in New Issue
Block a user