Skip to content
This repository has been archived by the owner on Mar 11, 2020. It is now read-only.

Commit

Permalink
remove final form focus because there is issue with it
Browse files Browse the repository at this point in the history
  • Loading branch information
tylim88 committed May 21, 2019
1 parent b429d6a commit f1690f2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 14 deletions.
5 changes: 0 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
"chart.js": "^2.7.3",
"classnames": "^2.2.6",
"final-form": "^4.12.0",
"final-form-focus": "^1.1.2",
"firebase": "^6.0.2",
"ky": "^0.10.0",
"localforage": "^1.7.3",
Expand Down
14 changes: 6 additions & 8 deletions src/views/SignUpPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import firebase from 'firebase'
// form validation
import { Form as FinalForm } from 'react-final-form'
import { string, boolean } from 'yup'
import createDecorator from 'final-form-focus'

// state management
import { Subscribe } from 'unstated'
Expand Down Expand Up @@ -33,8 +32,6 @@ import IndexNavbar from 'components/Navbars/IndexNavbar.jsx'
import Footer from 'components/Footer/Footer.jsx'
import InputField from 'components/InputField/InputField'

const focusOnError = createDecorator()

class SignUpPage extends React.Component {
state = {
squares1to6: '',
Expand Down Expand Up @@ -124,16 +121,14 @@ class SignUpPage extends React.Component {
password: '',
term: false,
}}
decorators={[focusOnError]}
onSubmit={(values, actions) => {
firebase
onSubmit={values => {
return firebase
.auth()
.createUserWithEmailAndPassword(
values.email,
values.password
)
.then(credential => {
actions.setSubmitting(false)
if (
credential.user &&
credential.user.emailVerified === false
Expand All @@ -145,10 +140,13 @@ class SignUpPage extends React.Component {
'email verification sent to user'
)
})
.catch(error => {
console.log('email user failed', error)
})
}
})
.catch(error => {
console.log(error)
console.log('submit failed', error)
})
}}>
{({ handleSubmit, submitting, validating }) => (
Expand Down

0 comments on commit f1690f2

Please sign in to comment.