11import { Button } from "@/components/ui/button" ;
2- import { Link } from "react-router" ;
2+ import { Link , data } from "react-router" ;
33import { Input } from "@/components/ui/input" ;
44import { Heading } from "@/components/ui/heading" ;
55import { Lock , Mail , UserRound } from "lucide-react" ;
6-
6+ import { useState } from "react" ;
7+ import { Cadastro } from "@/api/api" ;
8+
79export function Register ( ) {
10+ const [ nome , setNome ] = useState ( "" ) ;
11+ const [ email , setEmail ] = useState ( "" ) ;
12+ const [ cpf , setCpf ] = useState ( "" ) ;
13+ const [ dataNascimento , setDataNascimento ] = useState ( "" ) ;
14+ const [ senha , setSenha ] = useState ( "" ) ;
15+
16+
17+
18+
19+ async function submit ( event : any ) {
20+ event . preventDefault ( ) ;
21+ console . log ( nome )
22+ const resultado = await Cadastro ( nome , email , cpf , dataNascimento )
23+ console . log ( resultado )
24+ }
25+ // const cadastro = Cadastro(nome, email, cpf, dataNascimento)
826 return (
927 < >
1028 < style >
@@ -35,7 +53,7 @@ export function Register() {
3553 }
3654 ` }
3755 </ style >
38-
56+
3957 < div className = "flex items-center bg-gradient-to-b from-[#07080D] to-[#1D1F2C] w-screen h-[100vh] animate-fadeUp p-0 m-0" >
4058 < div className = "w-1/2 flex justify-center items-center" >
4159 < img src = "../../../banner.png" alt = "banner" />
@@ -45,40 +63,52 @@ export function Register() {
4563 < Heading className = "flex w-full font-bold text-white animate-fadeUp" >
4664 Criar Conta
4765 </ Heading >
48- < Input
49- type = "text"
50- label = "Nome Completo"
51- placeholder = "Digite seu nome completo"
52- iconRight = { < Mail /> }
53- className = "w-96"
54- />
55- < Input
56- type = "email"
57- label = "Endereço de E-mail"
58- placeholder = "Digite seu e-mail"
59- iconRight = { < Mail /> }
60- className = "w-96"
61- />
66+ < form onSubmit = { submit } >
67+ < Input
68+ name = "nome"
69+ onChange = { ( e ) => setNome ( e . target . value ) }
70+ type = "text"
71+ label = "Nome Completo"
72+ placeholder = "Digite seu nome completo"
73+ iconRight = { < Mail /> }
74+ className = "w-96"
75+ />
76+ < Input
77+ name = "email"
78+ onChange = { ( e ) => setEmail ( e . target . value ) }
79+ type = "email"
80+ label = "Endereço de E-mail"
81+ placeholder = "Digite seu e-mail"
82+ iconRight = { < Mail /> }
83+ className = "w-96"
84+ />
6285 < Input
86+ name = "cpf"
87+ onChange = { ( e ) => setCpf ( e . target . value ) }
6388 type = "text"
6489 label = "CPF"
6590 placeholder = "Digite seu CPF"
6691 iconRight = { < UserRound /> }
6792 className = "w-96"
6893 />
6994 < Input
95+ name = "dataNascimento"
96+ onChange = { ( e ) => setDataNascimento ( e . target . value ) }
7097 type = "date"
7198 label = "Data de Nascimento"
7299 placeholder = "Digite sua data de nascimento"
73100 // iconRight={<UserRound />}
74101 className = "text-slate-300 w-96 placeholder:text-slate-500"
75102 />
76103 < div className = "flex flex-col gap-2 items-center" >
77- < Link to = { '/confirmar-senha' } className = "w-full" >
104+ { /* <Link to={'/confirmar-senha'} className="w-full">
78105 <Button type="submit" className="text-lg h-12 w-96 text-black">Cadastrar</Button>
79- </ Link >
106+ </Link> */ }
107+ < Button type = "submit" className = "text-lg h-12 w-96 text-black" > Cadastrar</ Button >
80108 < p className = "text-gray-400" > Já tem uma conta? < Link className = "text-yellow-500 hover:underline hover:text-yellow-600 no-underline" to = { '/' } > Entrar</ Link > </ p >
81109 </ div >
110+ </ form >
111+
82112 </ div >
83113 </ div >
84114 </ div >
0 commit comments