// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. // See License.txt for license information. import {FormattedMessage} from 'react-intl'; import React from 'react'; import {Link} from 'react-router/es6'; import {resendVerification} from 'actions/user_actions.jsx'; export default class ShouldVerifyEmail extends React.Component { constructor(props) { super(props); this.handleResend = this.handleResend.bind(this); this.state = { resendStatus: 'none' }; } handleResend() { const email = this.props.location.query.email; this.setState({resendStatus: 'sending'}); resendVerification( email, () => { this.setState({resendStatus: 'success'}); }, () => { this.setState({resendStatus: 'failure'}); } ); } render() { let resendConfirm = ''; if (this.state.resendStatus === 'success') { resendConfirm = (

); } if (this.state.resendStatus === 'failure') { resendConfirm = (

); } return (

{resendConfirm}
); } } ShouldVerifyEmail.defaultProps = { }; ShouldVerifyEmail.propTypes = { location: React.PropTypes.object.isRequired };