diff options
author | Christopher Speller <crspeller@gmail.com> | 2016-03-16 18:16:11 -0400 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2016-03-16 18:16:11 -0400 |
commit | 4a4859351a4cd277f94d3faa804daaad0733b270 (patch) | |
tree | 4e7f83d3e2564b9b89d669e9f7905ff11768b11a /webapp/components/should_verify_email.jsx | |
parent | 29fe6a3d13c9c7aa490fffebbe5d1b5fdf1e3090 (diff) | |
parent | 12896bd23eeba79884245c1c29fdc568cf21a7fa (diff) | |
download | chat-4a4859351a4cd277f94d3faa804daaad0733b270.tar.gz chat-4a4859351a4cd277f94d3faa804daaad0733b270.tar.bz2 chat-4a4859351a4cd277f94d3faa804daaad0733b270.zip |
Merge pull request #2453 from mattermost/plt-2340
PLT-2340 Converting to Webpack. Stage 1.
Diffstat (limited to 'webapp/components/should_verify_email.jsx')
-rw-r--r-- | webapp/components/should_verify_email.jsx | 113 |
1 files changed, 113 insertions, 0 deletions
diff --git a/webapp/components/should_verify_email.jsx b/webapp/components/should_verify_email.jsx new file mode 100644 index 000000000..82beff067 --- /dev/null +++ b/webapp/components/should_verify_email.jsx @@ -0,0 +1,113 @@ +// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved. +// See License.txt for license information. + +import {FormattedMessage} from 'react-intl'; +import * as Client from 'utils/client.jsx'; + +import React from 'react'; + +export default class ShouldVerifyEmail extends React.Component { + constructor(props) { + super(props); + + this.handleResend = this.handleResend.bind(this); + + this.state = { + resendStatus: 'none' + }; + } + handleResend() { + const teamName = this.props.location.query.teamname; + const email = this.props.location.query.email; + + this.setState({resendStatus: 'sending'}); + + Client.resendVerification(() => { + this.setState({resendStatus: 'success'}); + }, + () => { + this.setState({resendStatus: 'failure'}); + }, + teamName, + email); + } + render() { + let resendConfirm = ''; + if (this.state.resendStatus === 'success') { + resendConfirm = ( + <div> + <br/> + <p className='alert alert-success'> + <i className='fa fa-check'/> + <FormattedMessage + id='email_verify.sent' + defaultMessage=' Verification email sent.' + /> + </p> + </div> + ); + } + + if (this.state.resendStatus === 'failure') { + resendConfirm = ( + <div> + <br/> + <p className='alert alert-danger'> + <i className='fa fa-times'/> + <FormattedMessage id='email_verify.failed'/> + </p> + </div> + ); + } + + return ( + <div> + <div className='signup-header'> + <a href='/'> + <span className='fa fa-chevron-left'/> + <FormattedMessage + id='web.header.back' + /> + </a> + </div> + <div className='col-sm-12'> + <div className='signup-team__container'> + <h3> + <FormattedMessage + id='email_verify.almost' + defaultMessage='{siteName}: You are almost done' + values={{ + siteName: global.window.mm_config.SiteName + }} + /> + </h3> + <div> + <p> + <FormattedMessage + id='email_verify.notVerifiedBody' + defaultMessage='Please verify your email address. Check your inbox for an email.' + /> + </p> + <button + onClick={this.handleResend} + className='btn btn-primary' + > + <FormattedMessage + id='email_verify.resend' + defaultMessage='Resend Email' + /> + </button> + {resendConfirm} + </div> + </div> + </div> + </div> + ); + } +} + +ShouldVerifyEmail.defaultProps = { +}; +ShouldVerifyEmail.propTypes = { + location: React.PropTypes.object.isRequired +}; |