import React from 'react'; import { Link } from 'react-router'; import { If, Case } from '/imports/client/components/Logic'; import { Bert } from 'meteor/themeteorchef:bert'; import './emailpane.css'; import { Row, Col, Alert,ControlLabel, FormGroup, FormControl, Button } from 'react-bootstrap'; export class EmailPane extends React.Component { constructor(props) { super(props); this.state = { email: props.user.emails[0].address, form: false, }; }; onUpdate(key, val) { this.setState({[key]: val}); }; onSetEmail() { startEmailVerification.call({email: this.state.email}, (err, res)=>{ Bert.alert('New verification email sent!', 'success'); }); this.setState({form: false}); }; onShowForm() { this.setState({form: true}); }; renderForm() { const {user} = this.props; return (
{/*
*/}
Enter your email address
Enter email this.onUpdate('email', evt.currentTarget.value)} placeholder = "Email" />
this.onSetEmail()} > Send verification email
); }; renderMessage() { const {user} = this.props; return (
{/* */}

Your email needs verification

Please check your email – we sent a verification link to
{user.emails[0].address}
this.onShowForm()} > Email did not arrive or want to use a different email?
); }; render() { return this.state.form ? this.renderForm() : this.renderMessage(); }; };