Skip to content

Commit 2f8b27d

Browse files
committed
✨ Add validation on FormForgot
1 parent 470dbc9 commit 2f8b27d

File tree

1 file changed

+22
-3
lines changed

1 file changed

+22
-3
lines changed

src/containers/FormForgot/index.js

+22-3
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,38 @@ import ButtonCollab from "../../components/ButtonCollab";
77
import FormAuth from "../../containers/FormAuth";
88
import LabelCollab from "../../components/LabelCollab";
99

10+
import useValidation from "../../libs/validation/useValidation";
11+
import validation from "./validation";
12+
1013
function FormForgot() {
14+
const { value, handleChange, handleSubmit, errors } = useValidation(
15+
validation,
16+
sendFormForgot,
17+
"email"
18+
);
19+
20+
function sendFormForgot() {}
21+
1122
return (
12-
<FormAuth>
23+
<FormAuth noValidate onSubmit={handleSubmit}>
1324
<TitleCollab content="Esqueci minha senha" />
1425

1526
<LabelCollab
1627
content="Informe seu e-mail para alterar a sua senha"
1728
warning={true}
1829
/>
1930

20-
<FieldCollab content="E-mail:" htmlFor="email" id="email" />
31+
<FieldCollab
32+
content="E-mail:"
33+
htmlFor="email"
34+
id="email"
35+
name="email"
36+
value={value.email}
37+
msgError={errors.email}
38+
onChange={handleChange}
39+
/>
2140

22-
<ButtonCollab content="Enviar" to="/dashboard" />
41+
<ButtonCollab content="Enviar" to="/dashboard" as="button" />
2342
</FormAuth>
2443
);
2544
}

0 commit comments

Comments
 (0)