Various repairs to broken signup button not submitting data
This commit is contained in:
parent
d65f8e720f
commit
3f05cd8dfd
|
@ -14,7 +14,7 @@ import { Signup } from "./pages/Signup"
|
|||
|
||||
function App() {
|
||||
const FBapp = initializeApp(FirebaseConfig)
|
||||
const FBauth = getAuth(FBapp)
|
||||
const FBauth = getAuth()
|
||||
// navigation array
|
||||
const navItems = [
|
||||
{ label: "Home", link: "/" },
|
||||
|
@ -47,6 +47,8 @@ function App() {
|
|||
})
|
||||
.catch((error) => console.log(error.message))
|
||||
}
|
||||
|
||||
|
||||
return (
|
||||
<div className="App">
|
||||
<Header items={nav} />
|
||||
|
|
|
@ -10,11 +10,12 @@ export function Signup ( props ) {
|
|||
const[validusername,setValidusername] = useState(false)
|
||||
const[useremail,setUseremail] = useState('')
|
||||
const[validemail,setValidemail] = useState(false)
|
||||
const[password,setUserpassword] = useState('')
|
||||
const[userpassword,setUserpassword] = useState('')
|
||||
const[validpassword,setValidpassword] = useState(false)
|
||||
|
||||
const submitHandler = (evt) => {
|
||||
evt.preventDefault()
|
||||
props.handler(useremail, password)
|
||||
props.handler( useremail, userpassword )
|
||||
}
|
||||
|
||||
useEffect( () => {
|
||||
|
@ -36,20 +37,20 @@ export function Signup ( props ) {
|
|||
}, [useremail])
|
||||
|
||||
useEffect( () => {
|
||||
if( password.length >= 8 ) {
|
||||
if( userpassword.length >= 8 ) {
|
||||
setValidpassword(true)
|
||||
}
|
||||
else{
|
||||
setValidpassword(false)
|
||||
}
|
||||
}, [password] )
|
||||
}, [userpassword])
|
||||
|
||||
return (
|
||||
|
||||
<Container>
|
||||
<Row>
|
||||
<Col md={{span: 4, offset:4}}>
|
||||
<Form>
|
||||
<Form onSubmit={submitHandler}>
|
||||
<Form.Group>
|
||||
<Form.Label>Username</Form.Label>
|
||||
<Form.Control
|
||||
|
|
Loading…
Reference in New Issue