Create account page now has form
This commit is contained in:
@@ -4,11 +4,44 @@ import './Login.css';
|
|||||||
|
|
||||||
function CreateAccount() {
|
function CreateAccount() {
|
||||||
|
|
||||||
|
const navigate = useNavigate();
|
||||||
|
|
||||||
|
const navigateLogin = () => {
|
||||||
|
navigate('/');
|
||||||
|
}
|
||||||
|
|
||||||
|
const [data,setData] = useState({
|
||||||
|
username:"",
|
||||||
|
password:"",
|
||||||
|
email:"",
|
||||||
|
})
|
||||||
|
|
||||||
|
const {username,password,email} = data;
|
||||||
|
|
||||||
|
const changeHandler = e => {
|
||||||
|
setData({...data,[e.target.name]:[e.target.value]});
|
||||||
|
}
|
||||||
|
|
||||||
|
const submitHandler = e => {
|
||||||
|
e.preventDefault();
|
||||||
|
console.log(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<center>
|
<center>
|
||||||
<h1>Create Account</h1>
|
<h1>Create Account</h1>
|
||||||
|
<p>Enter your account information</p>
|
||||||
|
<form onSubmit={submitHandler}>
|
||||||
|
<p>Username:</p>
|
||||||
|
<input type="text" name="username" value={username} onChange={changeHandler}/><br/>
|
||||||
|
<p>Password:</p>
|
||||||
|
<input type="password" name="password" value={password} onChange={changeHandler}/><br/>
|
||||||
|
<p>Email:</p>
|
||||||
|
<input type="email" name="email" value={email} onChange={changeHandler}/><br/>
|
||||||
|
<input type="submit" name="submit"/>
|
||||||
|
</form>
|
||||||
|
|
||||||
</center>
|
</center>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -31,7 +31,9 @@ function Login() {
|
|||||||
<h1>Log In</h1>
|
<h1>Log In</h1>
|
||||||
<p>Log in to your account</p>
|
<p>Log in to your account</p>
|
||||||
<form onSubmit={submitHandler}>
|
<form onSubmit={submitHandler}>
|
||||||
<input type="text" name="username" value={username} onChange={changeHandler}/><br/>
|
<p>Username:</p>
|
||||||
|
<input type="text" name="username" value={username} onChange={changeHandler}/>
|
||||||
|
<p>Password:</p>
|
||||||
<input type="password" name="password" value={password} onChange={changeHandler}/><br/>
|
<input type="password" name="password" value={password} onChange={changeHandler}/><br/>
|
||||||
<input type="submit" name="submit"/>
|
<input type="submit" name="submit"/>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
Reference in New Issue
Block a user