diff --git a/GrossesMitaines/grosses-mitaines-ui/src/pages/Register.js b/GrossesMitaines/grosses-mitaines-ui/src/pages/Register.js index 6443b8c..160d10a 100644 --- a/GrossesMitaines/grosses-mitaines-ui/src/pages/Register.js +++ b/GrossesMitaines/grosses-mitaines-ui/src/pages/Register.js @@ -1,70 +1,86 @@ import { useState } from "react"; import { Button } from "react-bootstrap"; +import { useForm } from "react-hook-form"; -const Register = () => { +// const Register = () => { - //const [username, setUsername] = useState(""); - //const [password, setPassword] = useState(""); +// //const [username, setUsername] = useState(""); +// //const [password, setPassword] = useState(""); - const handleLogin = async (e) => { - e.preventDefault(); +// // const handleLogin = async (e) => { +// // e.preventDefault(); - const response = await fetch(`https://localhost:7292/api/Login?rememberme=true`, { - method: 'POST', - headers: { - 'Accept': 'application/json', - 'Content-Type': 'application/json' - }, - //body: JSON.stringify({ username, password }) - }) +// // const response = await fetch(`https://localhost:7292/api/Login?rememberme=true`, { +// // method: 'POST', +// // headers: { +// // 'Accept': 'application/json', +// // 'Content-Type': 'application/json' +// // }, +// // //body: JSON.stringify({ username, password }) +// // }) - // Partie de display d'erreur ou de redirection (faudrait checker pour se faire un state de connexion). +// // Partie de display d'erreur ou de redirection (faudrait checker pour se faire un state de connexion). - } +// } - return ( +export default function App() { + const { register, handleSubmit, watch, formState: { errors } } = useForm(); + const onSubmit = data => console.log(data); +return (