import React from 'react'; import PropTypes from 'prop-types'; import { Alert } from 'react-bootstrap'; import { Meteor } from 'meteor/meteor'; import { Accounts } from 'meteor/accounts-base'; import { Bert } from 'meteor/themeteorchef:bert'; class VerifyEmail extends React.Component { constructor(props) { super(props); this.state = { error: null }; } componentDidMount() { const { match, history } = this.props; Accounts.verifyEmail(match.params.token, (error) => { if (error) { Bert.alert(error.reason, 'danger'); this.setState({ error: `${error.reason}. Please try again.` }); } else { setTimeout(() => { Bert.alert('All set, thanks!', 'success'); history.push('/documents'); }, 1500); } }); } render() { return (