summaryrefslogtreecommitdiffstats
path: root/web/react/components/team_signup_email_item.jsx
diff options
context:
space:
mode:
author=Corey Hulen <corey@hulen.com>2016-02-01 14:44:17 -0800
committer=Corey Hulen <corey@hulen.com>2016-02-01 14:44:17 -0800
commitb4ec6900510077253290e361d1a706e5368a45de (patch)
tree6fc7c131fa7aa5f32e3aba8102416aa23c65963d /web/react/components/team_signup_email_item.jsx
parentea71731f838fc010cfc7511c09875184d1b2396b (diff)
parentf28486c4553f7f4bccf7bf69153c2f12699705f9 (diff)
downloadchat-b4ec6900510077253290e361d1a706e5368a45de.tar.gz
chat-b4ec6900510077253290e361d1a706e5368a45de.tar.bz2
chat-b4ec6900510077253290e361d1a706e5368a45de.zip
Fixing merge
Diffstat (limited to 'web/react/components/team_signup_email_item.jsx')
-rw-r--r--web/react/components/team_signup_email_item.jsx29
1 files changed, 25 insertions, 4 deletions
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