From 94a19ae75e71b59d01a37cc1c0415d5796d45440 Mon Sep 17 00:00:00 2001
From: Elias Nahum <nahumhbl@gmail.com>
Date: Fri, 29 Jan 2016 00:24:43 -0300
Subject: PLT-7: Refactoring frontend (chunk 5) - Signup Team Complete - Signup
 User Complete - Email Verify

---
 web/react/components/team_signup_email_item.jsx | 29 +++++++++++++++++++++----
 1 file changed, 25 insertions(+), 4 deletions(-)

(limited to 'web/react/components/team_signup_email_item.jsx')

diff --git a/web/react/components/team_signup_email_item.jsx b/web/react/components/team_signup_email_item.jsx
index 59c4771d7..feb70dc71 100644
--- a/web/react/components/team_signup_email_item.jsx
+++ b/web/react/components/team_signup_email_item.jsx
@@ -3,7 +3,24 @@
 
 import * as Utils from '../utils/utils.jsx';
 
-export default class TeamSignupEmailItem extends React.Component {
+import {intlShape, injectIntl, defineMessages} from 'mm-intl';
+
+const holders = defineMessages({
+    validEmail: {
+        id: 'team_signup_email.validEmail',
+        defaultMessage: 'Please enter a valid email address'
+    },
+    different: {
+        id: 'team_signup_email.different',
+        defaultMessage: 'Please use a different email than the one used at signup'
+    },
+    address: {
+        id: 'team_signup_email.address',
+        defaultMessage: 'Email Address'
+    }
+});
+
+class TeamSignupEmailItem extends React.Component {
     constructor(props) {
         super(props);
 
@@ -16,6 +33,7 @@ export default class TeamSignupEmailItem extends React.Component {
         return ReactDOM.findDOMNode(this.refs.email).value.trim();
     }
     validate(teamEmail) {
+        const {formatMessage} = this.props.intl;
         const email = ReactDOM.findDOMNode(this.refs.email).value.trim().toLowerCase();
 
         if (!email) {
@@ -23,10 +41,10 @@ export default class TeamSignupEmailItem extends React.Component {
         }
 
         if (!Utils.isEmail(email)) {
-            this.setState({emailError: 'Please enter a valid email address'});
+            this.setState({emailError: formatMessage(holders.validEmail)});
             return false;
         } else if (email === teamEmail) {
-            this.setState({emailError: 'Please use a different email than the one used at signup'});
+            this.setState({emailError: formatMessage(holders.different)});
             return false;
         }
 
@@ -48,7 +66,7 @@ export default class TeamSignupEmailItem extends React.Component {
                     type='email'
                     ref='email'
                     className='form-control'
-                    placeholder='Email Address'
+                    placeholder={this.props.intl.formatMessage(holders.address)}
                     defaultValue={this.props.email}
                     maxLength='128'
                     spellCheck='false'
@@ -60,6 +78,9 @@ export default class TeamSignupEmailItem extends React.Component {
 }
 
 TeamSignupEmailItem.propTypes = {
+    intl: intlShape.isRequired,
     focus: React.PropTypes.bool,
     email: React.PropTypes.string
 };
+
+export default injectIntl(TeamSignupEmailItem);
\ No newline at end of file
-- 
cgit v1.2.3-1-g7c22

