import React from "react"; import {useNavigate} from "react-router-dom"; import CenteredContainer from "../UtilComponents/CenteredContainer"; import '../UtilComponents/App.css' const registerPassenger = (props) => { // eslint-disable-next-line react-hooks/rules-of-hooks const navigate = useNavigate(); // eslint-disable-next-line react-hooks/rules-of-hooks const [formData, updateFormData] = React.useState({ firstName : "", surname : "", email : "", password : "", repeatedPassword: "", }) const handleChange = (e) => { updateFormData({ ...formData, [e.target.name]: e.target.value.trim() }) } const onFormSubmit = (e) => { e.preventDefault(); const firstName = formData.firstName const surname = formData.surname const email = formData.email const password = formData.password const repetedPassword = formData.repeatedPassword if(password !== repetedPassword) alert("Passwords don't match"); props.onRegisterPassenger(firstName, surname, email, password); navigate("/login") } return(

Register Passenger













) } export default registerPassenger;