Add AuthContext to signup.js
This commit is contained in:
parent
1f39645265
commit
b682d93e92
|
@ -2,8 +2,9 @@ import Form from 'react-bootstrap/Form';
|
||||||
import Container from 'react-bootstrap/Container';
|
import Container from 'react-bootstrap/Container';
|
||||||
import Row from 'react-bootstrap/Row';
|
import Row from 'react-bootstrap/Row';
|
||||||
import Col from 'react-bootstrap/Col';
|
import Col from 'react-bootstrap/Col';
|
||||||
import Button from "react-bootstrap/Button"
|
import Button from "react-bootstrap/Button";
|
||||||
import {useState, useEffect} from 'react';
|
import {useState, useEffect, useContext} from 'react';
|
||||||
|
import { AuthContext } from "../contexts/AuthContext";
|
||||||
|
|
||||||
export function Signup ( props ) {
|
export function Signup ( props ) {
|
||||||
const[username,setUsername] = useState('')
|
const[username,setUsername] = useState('')
|
||||||
|
@ -13,6 +14,8 @@ export function Signup ( props ) {
|
||||||
const[userpassword,setUserpassword] = useState('')
|
const[userpassword,setUserpassword] = useState('')
|
||||||
const[validpassword,setValidpassword] = useState(false)
|
const[validpassword,setValidpassword] = useState(false)
|
||||||
|
|
||||||
|
const auth = useContext(AuthContext)
|
||||||
|
|
||||||
const submitHandler = (evt) => {
|
const submitHandler = (evt) => {
|
||||||
evt.preventDefault()
|
evt.preventDefault()
|
||||||
props.handler( useremail, userpassword )
|
props.handler( useremail, userpassword )
|
||||||
|
|
Loading…
Reference in New Issue