1- import React , { Component } from 'react'
1+ import React , { Component } from 'react'
22import Formsy from 'formsy-react'
33import TextInput from '../Formsy/TextInput'
44import PhoneInput from '../Formsy/PhoneInput'
@@ -52,18 +52,18 @@ class RegistrationScreen extends Component {
5252 }
5353
5454 reRender ( ) {
55- this . setState ( { update : true } )
55+ this . setState ( { update : true } )
5656 }
5757
58- onChangeCountry ( { country} ) {
59- const { vm } = this . props
58+ onChangeCountry ( { country } ) {
59+ const { vm } = this . props
6060
6161 if ( ! country || ! country . code ) {
6262 vm . phoneErrorMessage = 'Please enter a valid phone number.'
6363 this . reRender ( )
6464 } else {
6565 vm . phoneErrorMessage = null
66- this . setState ( { update : true , country} )
66+ this . setState ( { update : true , country } )
6767 }
6868 }
6969
@@ -80,14 +80,14 @@ class RegistrationScreen extends Component {
8080 }
8181
8282 isValidForm ( ) {
83- const { vm } = this . props
84- const { canSubmit} = this . state
83+ const { vm } = this . props
84+ const { canSubmit } = this . state
8585 return ! vm . loading && canSubmit && ! vm . usernameErrorMessage && ! vm . emailErrorMessage && ! vm . phoneErrorMessage && this . state . country
8686 }
8787
8888 submit ( form ) {
89- const { vm } = this . props
90- const { country} = this . state
89+ const { vm } = this . props
90+ const { country } = this . state
9191 const fullName = form . name
9292 vm . phone = form . phone
9393 vm . title = form . title
@@ -99,13 +99,13 @@ class RegistrationScreen extends Component {
9999 vm . country = country
100100 vm . firstName = fullName . trim ( ) . split ( ' ' ) . slice ( 0 , - 1 ) . join ( ' ' )
101101 vm . lastName = fullName . trim ( ) . split ( ' ' ) . slice ( - 1 ) . join ( ' ' )
102-
102+
103103 vm . submit ( )
104104
105105 }
106106
107107 render ( ) {
108- const { vm } = this . props
108+ const { vm } = this . props
109109 let preFillName = vm . firstName ? vm . firstName : null
110110 preFillName = vm . lastName ? `${ preFillName } ${ vm . lastName } ` : preFillName
111111 const preFillEmail = vm . email ? vm . email : null
@@ -114,7 +114,7 @@ class RegistrationScreen extends Component {
114114 < div className = "container flex column middle center" >
115115 < div className = "title" > Let's start with introductions</ div >
116116 < div className = "sub-title" > First we need to know you a bit better</ div >
117- { vm . errorMessage && ( < div className = "server-error-message" > { vm . errorMessage } </ div > ) }
117+ { vm . errorMessage && ( < div className = "server-error-message" > { vm . errorMessage } </ div > ) }
118118 < Formsy . Form onValidSubmit = { this . submit } onValid = { this . enableButton } onInvalid = { this . disableButton } className = "form flex column middle center" >
119119 < TextInput
120120 wrapperClass = { 'input-container' }
@@ -203,7 +203,7 @@ class RegistrationScreen extends Component {
203203 validator = { vm . usernameIsFree }
204204 showCheckMark
205205 />
206- { ! vm . ssoUser && < PasswordInput
206+ { ! vm . ssoUser && < PasswordInput
207207 wrapperClass = { 'input-container' }
208208 label = "Create a password (8–64 characters, A–Z, 0–9, . _ - ! ? allowed)"
209209 name = "password"
@@ -227,10 +227,9 @@ class RegistrationScreen extends Component {
227227 wrapperClass = { 'input-container' }
228228 label = "I agree to receive other communications from Topcoder."
229229 name = "agreeTerm"
230- required
231230 />
232231 < div className = "space" />
233- < button type = "submit" className = "tc-btn tc-btn-sm tc-btn-primary flex middle center" disabled = { vm . loading || ! this . state . canSubmit || ! this . state . country } > Continue</ button >
232+ < button type = "submit" className = "tc-btn tc-btn-sm tc-btn-primary flex middle center" disabled = { vm . loading || ! this . state . canSubmit || ! this . state . country } > Continue</ button >
234233 < div className = "by-clicking-continue" > By clicking “Continue” you agree to our < a href = { vm . termsUrl } > Terms</ a > and < a href = { vm . privacyUrl } > Privacy Policy</ a > .
235234 We are never going to sell your data or send you spam messages. Your email is going to be used for communication purposes only.</ div >
236235 </ Formsy . Form >
0 commit comments