1
- import React , { Component } from 'react'
1
+ import React , { Component } from 'react'
2
2
import Formsy from 'formsy-react'
3
3
import TextInput from '../Formsy/TextInput'
4
4
import PhoneInput from '../Formsy/PhoneInput'
@@ -52,18 +52,18 @@ class RegistrationScreen extends Component {
52
52
}
53
53
54
54
reRender ( ) {
55
- this . setState ( { update : true } )
55
+ this . setState ( { update : true } )
56
56
}
57
57
58
- onChangeCountry ( { country} ) {
59
- const { vm } = this . props
58
+ onChangeCountry ( { country } ) {
59
+ const { vm } = this . props
60
60
61
61
if ( ! country || ! country . code ) {
62
62
vm . phoneErrorMessage = 'Please enter a valid phone number.'
63
63
this . reRender ( )
64
64
} else {
65
65
vm . phoneErrorMessage = null
66
- this . setState ( { update : true , country} )
66
+ this . setState ( { update : true , country } )
67
67
}
68
68
}
69
69
@@ -80,14 +80,14 @@ class RegistrationScreen extends Component {
80
80
}
81
81
82
82
isValidForm ( ) {
83
- const { vm } = this . props
84
- const { canSubmit} = this . state
83
+ const { vm } = this . props
84
+ const { canSubmit } = this . state
85
85
return ! vm . loading && canSubmit && ! vm . usernameErrorMessage && ! vm . emailErrorMessage && ! vm . phoneErrorMessage && this . state . country
86
86
}
87
87
88
88
submit ( form ) {
89
- const { vm } = this . props
90
- const { country} = this . state
89
+ const { vm } = this . props
90
+ const { country } = this . state
91
91
const fullName = form . name
92
92
vm . phone = form . phone
93
93
vm . title = form . title
@@ -99,13 +99,13 @@ class RegistrationScreen extends Component {
99
99
vm . country = country
100
100
vm . firstName = fullName . trim ( ) . split ( ' ' ) . slice ( 0 , - 1 ) . join ( ' ' )
101
101
vm . lastName = fullName . trim ( ) . split ( ' ' ) . slice ( - 1 ) . join ( ' ' )
102
-
102
+
103
103
vm . submit ( )
104
104
105
105
}
106
106
107
107
render ( ) {
108
- const { vm } = this . props
108
+ const { vm } = this . props
109
109
let preFillName = vm . firstName ? vm . firstName : null
110
110
preFillName = vm . lastName ? `${ preFillName } ${ vm . lastName } ` : preFillName
111
111
const preFillEmail = vm . email ? vm . email : null
@@ -114,7 +114,7 @@ class RegistrationScreen extends Component {
114
114
< div className = "container flex column middle center" >
115
115
< div className = "title" > Let's start with introductions</ div >
116
116
< 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 > ) }
118
118
< Formsy . Form onValidSubmit = { this . submit } onValid = { this . enableButton } onInvalid = { this . disableButton } className = "form flex column middle center" >
119
119
< TextInput
120
120
wrapperClass = { 'input-container' }
@@ -203,7 +203,7 @@ class RegistrationScreen extends Component {
203
203
validator = { vm . usernameIsFree }
204
204
showCheckMark
205
205
/>
206
- { ! vm . ssoUser && < PasswordInput
206
+ { ! vm . ssoUser && < PasswordInput
207
207
wrapperClass = { 'input-container' }
208
208
label = "Create a password (8–64 characters, A–Z, 0–9, . _ - ! ? allowed)"
209
209
name = "password"
@@ -227,10 +227,9 @@ class RegistrationScreen extends Component {
227
227
wrapperClass = { 'input-container' }
228
228
label = "I agree to receive other communications from Topcoder."
229
229
name = "agreeTerm"
230
- required
231
230
/>
232
231
< 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 >
234
233
< 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 > .
235
234
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 >
236
235
</ Formsy . Form >
0 commit comments