diff options
author | hmhealey <harrisonmhealey@gmail.com> | 2015-08-31 11:31:55 -0400 |
---|---|---|
committer | hmhealey <harrisonmhealey@gmail.com> | 2015-09-01 18:45:18 -0400 |
commit | 7d07bf6a79c9507b2178338464f7d28ce9a9a4ac (patch) | |
tree | fce94a47f975e845a913454e768f135df2a0e5ed /web/react/components/team_signup_with_email.jsx | |
parent | 72575ac7bdd5bfe7bd544ba238f8d1c0126635aa (diff) | |
download | chat-7d07bf6a79c9507b2178338464f7d28ce9a9a4ac.tar.gz chat-7d07bf6a79c9507b2178338464f7d28ce9a9a4ac.tar.bz2 chat-7d07bf6a79c9507b2178338464f7d28ce9a9a4ac.zip |
Refactored various React components to use ES6 syntax and to match the style guide without any errors or warnings
Diffstat (limited to 'web/react/components/team_signup_with_email.jsx')
-rw-r--r-- | web/react/components/team_signup_with_email.jsx | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/web/react/components/team_signup_with_email.jsx b/web/react/components/team_signup_with_email.jsx index c7204880f..c0bbb7da9 100644 --- a/web/react/components/team_signup_with_email.jsx +++ b/web/react/components/team_signup_with_email.jsx @@ -1,8 +1,8 @@ // Copyright (c) 2015 Spinpunch, Inc. All Rights Reserved. // See License.txt for license information. -var utils = require('../utils/utils.jsx'); -var client = require('../utils/client.jsx'); +const Utils = require('../utils/utils.jsx'); +const Client = require('../utils/client.jsx'); export default class EmailSignUpPage extends React.Component { constructor() { @@ -14,11 +14,11 @@ export default class EmailSignUpPage extends React.Component { } handleSubmit(e) { e.preventDefault(); - var team = {}; - var state = {serverError: ''}; + let team = {}; + let state = {serverError: ''}; - team.email = this.refs.email.getDOMNode().value.trim().toLowerCase(); - if (!team.email || !utils.isEmail(team.email)) { + team.email = React.findDOMNode(this.refs.email).value.trim().toLowerCase(); + if (!team.email || !Utils.isEmail(team.email)) { state.emailError = 'Please enter a valid email address'; state.inValid = true; } else { @@ -30,12 +30,12 @@ export default class EmailSignUpPage extends React.Component { return; } - client.signupTeam(team.email, + Client.signupTeam(team.email, function success(data) { if (data.follow_link) { window.location.href = data.follow_link; } else { - window.location.href = '/signup_team_confirm/?email=' + encodeURIComponent(team.email); + window.location.href = `/signup_team_confirm/?email=${encodeURIComponent(team.email)}`; } }, function fail(err) { @@ -69,7 +69,7 @@ export default class EmailSignUpPage extends React.Component { </button> </div> <div className='form-group margin--extra-2x'> - <span><a href='/find_team'>{'Find my ' + strings.Team}</a></span> + <span><a href='/find_team'>{`Find my ${strings.Team}`}</a></span> </div> </form> ); |