diff --git a/src/pages/auth/SignUpForm.js b/src/pages/auth/SignUpForm.js index 5cbc808..ef45b11 100644 --- a/src/pages/auth/SignUpForm.js +++ b/src/pages/auth/SignUpForm.js @@ -1,4 +1,4 @@ -import React from "react"; +import React, { useState } from "react"; import { Link } from "react-router-dom"; import styles from "../../styles/SignInUpForm.module.css"; @@ -6,8 +6,23 @@ import btnStyles from "../../styles/Button.module.css"; import appStyles from "../../App.module.css"; import { Form, Button, Image, Col, Row, Container } from "react-bootstrap"; +import { useHistory } from "react-router-dom"; const SignUpForm = () => { + const [signUpData, setSignUpData] = useState({ + username: "", + password1: "", + password2: "", + }); + const { username, password1, password2 } = signUpData; + + const handleChange = (event) => { + setSignUpData({ + ...signUpData, + [event.target.name]: event.target.value, + }); + }; + return ( { type="text" placeholder="Username" name="username" + value={username} + onChange={handleChange} /> @@ -42,6 +59,8 @@ const SignUpForm = () => { type="password" placeholder="Password" name="password1" + value={password1} + onChange={handleChange} /> @@ -52,13 +71,13 @@ const SignUpForm = () => { type="password" placeholder="Confirm password" name="password2" + value={password2} + onChange={handleChange} />