import { Fragment, useContext, useState } from 'react'; import { useRouter } from 'next/router'; import Link from 'next/link'; import htmlParser from 'html-react-parser'; import Loader from '../components/Loader'; import HeadTag from '../components/HeadTag'; import { UserContext } from '../contexts/UserContext'; import '../public/css/pages/register-login.css'; const Login = () => { const router = useRouter(); const [inputState, setInputState] = useState({}); const { loginUser, messageLogin, loginLoading } = useContext(UserContext); const handleChange = () => { const inputStateNew = { ...inputState }; inputStateNew[event.target.name] = event.target.value; setInputState(inputStateNew); } const handleSubmit = (event) => { event.preventDefault(); loginUser(inputState); } return (

Se connecter

Mot de passe oublié ?

{(router.query.isConfirmed !== undefined) &&

Succès: Votre compte a bien été confirmé, vous pouvez maintenant vous connectez!

} { (loginLoading) ? : htmlParser(messageLogin) }
); } export default Login;