registration

This commit is contained in:
Mikola
2023-11-05 20:41:40 +03:00
parent 1e9ee3699d
commit 321b84a80e
6 changed files with 37 additions and 14 deletions

View File

@ -26,6 +26,14 @@ export const ModalRegistration = ({ active, setActive }) => {
// возвращаем true, если email проходит проверку, и false, если нет
return re.test(email);
};
const resetInputsValue = () => {
setInputsValue({
userName: "",
email: "",
password: "",
})
}
const { showNotification } = useNotification();
@ -39,6 +47,7 @@ export const ModalRegistration = ({ active, setActive }) => {
},
}).then(() => {
setActive(false);
resetInputsValue()
showNotification({
show: true,
text: "Аккаунт успешно создан",
@ -105,7 +114,9 @@ export const ModalRegistration = ({ active, setActive }) => {
submitHandler();
}}
styles={
inputsValue.userName && validateEmail(inputsValue.email) && inputsValue.password
inputsValue.userName &&
validateEmail(inputsValue.email) &&
inputsValue.password
? "button-box__submit"
: "button-box__submit disable"
}