summaryrefslogtreecommitdiffstats
path: root/web/react/components/team_signup_with_email.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'web/react/components/team_signup_with_email.jsx')
-rw-r--r--web/react/components/team_signup_with_email.jsx20
1 files changed, 13 insertions, 7 deletions
diff --git a/web/react/components/team_signup_with_email.jsx b/web/react/components/team_signup_with_email.jsx
index 4fb1c0d01..015969dce 100644
--- a/web/react/components/team_signup_with_email.jsx
+++ b/web/react/components/team_signup_with_email.jsx
@@ -14,8 +14,8 @@ export default class EmailSignUpPage extends React.Component {
}
handleSubmit(e) {
e.preventDefault();
- let team = {};
- let state = {serverError: ''};
+ var team = {};
+ var state = {serverError: ''};
team.email = React.findDOMNode(this.refs.email).value.trim().toLowerCase();
if (!team.email || !Utils.isEmail(team.email)) {
@@ -31,20 +31,25 @@ export default class EmailSignUpPage extends React.Component {
}
Client.signupTeam(team.email,
- function success(data) {
+ (data) => {
if (data.follow_link) {
window.location.href = data.follow_link;
} else {
window.location.href = `/signup_team_confirm/?email=${encodeURIComponent(team.email)}`;
}
},
- function fail(err) {
+ (err) => {
state.serverError = err.message;
this.setState(state);
- }.bind(this)
+ }
);
}
render() {
+ var serverError = null;
+ if (this.state.serverError) {
+ serverError = <div className='form-group has-error'><label className='control-label'>{this.state.serverError}</label></div>;
+ }
+
return (
<form
role='form'
@@ -65,11 +70,12 @@ export default class EmailSignUpPage extends React.Component {
className='btn btn-md btn-primary'
type='submit'
>
- Sign up
+ {'Sign up'}
</button>
+ {serverError}
</div>
<div className='form-group margin--extra-2x'>
- <span><a href='/find_team'>{`Find my team`}</a></span>
+ <span><a href='/find_team'>{`Find my teams`}</a></span>
</div>
</form>
);