// 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'); module.exports = React.createClass({ handleSubmit: function(e) { e.preventDefault(); var state = { }; var email = this.refs.email.getDOMNode().value.trim().toLowerCase(); if (!email || !utils.isEmail(email)) { state.email_error = "Please enter a valid email address"; this.setState(state); return; } else { state.email_error = ""; } client.findTeamsSendEmail(email, function(data) { state.sent = true; this.setState(state); }.bind(this), function(err) { state.email_error = err.message; this.setState(state); }.bind(this) ); }, getInitialState: function() { return { }; }, render: function() { var email_error = this.state.email_error ? : null; var divStyle = { "marginTop": "50px", } if (this.state.sent) { return (

{"Find Your " + utils.toTitleCase(strings.Team)}

{"An email was sent with links to any " + strings.TeamPlural}

); } return (

Find Your Team

{"An email will be sent to this address with links to any " + strings.TeamPlural}

{ email_error }
); } });