registration
This commit is contained in:
parent
baf353d7cd
commit
98bf179b9e
@ -4,6 +4,7 @@ import { apiRequest } from "@api/request";
|
|||||||
|
|
||||||
import BaseButton from "@components/Common/BaseButton/BaseButton";
|
import BaseButton from "@components/Common/BaseButton/BaseButton";
|
||||||
import ModalLayout from "@components/Common/ModalLayout/ModalLayout";
|
import ModalLayout from "@components/Common/ModalLayout/ModalLayout";
|
||||||
|
import { useNotification } from "@hooks/useNotification";
|
||||||
|
|
||||||
import anyMoment from "assets/icons/anyMoment.svg";
|
import anyMoment from "assets/icons/anyMoment.svg";
|
||||||
import doc from "assets/icons/doc.svg";
|
import doc from "assets/icons/doc.svg";
|
||||||
@ -17,7 +18,7 @@ export const ModalRegistration = ({ active, setActive }) => {
|
|||||||
email: "",
|
email: "",
|
||||||
password: "",
|
password: "",
|
||||||
});
|
});
|
||||||
|
const { showNotification } = useNotification();
|
||||||
const submitHandler = () => {
|
const submitHandler = () => {
|
||||||
apiRequest("/register/sign-up", {
|
apiRequest("/register/sign-up", {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
@ -26,8 +27,13 @@ export const ModalRegistration = ({ active, setActive }) => {
|
|||||||
email: inputsValue.email,
|
email: inputsValue.email,
|
||||||
password: inputsValue.password,
|
password: inputsValue.password,
|
||||||
},
|
},
|
||||||
}).then((data) => {
|
}).then(() => {
|
||||||
console.log(data);
|
setActive(false)
|
||||||
|
showNotification({
|
||||||
|
show: true,
|
||||||
|
text: "Аккаунт успешно создан",
|
||||||
|
type: "success"
|
||||||
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
return (
|
return (
|
||||||
@ -84,7 +90,10 @@ export const ModalRegistration = ({ active, setActive }) => {
|
|||||||
</div>
|
</div>
|
||||||
<div className="button-box">
|
<div className="button-box">
|
||||||
<BaseButton
|
<BaseButton
|
||||||
onClick={() => submitHandler()}
|
onClick={(e) => {
|
||||||
|
e.preventDefault()
|
||||||
|
submitHandler()
|
||||||
|
}}
|
||||||
styles={
|
styles={
|
||||||
inputsValue.userName && inputsValue.email && inputsValue.password
|
inputsValue.userName && inputsValue.email && inputsValue.password
|
||||||
? "button-box__submit"
|
? "button-box__submit"
|
||||||
|
Loading…
Reference in New Issue
Block a user