Blame view

imports/client/views/verify/EmailPane.js 2.9 KB
878ca8a15   Deepak   added signup form...
1
2
3
4
  import React                              from 'react';
  import { Link }                           from 'react-router';
  import { If, Case }                       from '/imports/client/components/Logic';
  import { Bert }                             from 'meteor/themeteorchef:bert';
db3748612   ajaiprakash   Verify Email styling
5
  import './emailpane.css';
878ca8a15   Deepak   added signup form...
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
  
  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 (
dc0d0c739   Deepak   merged Ajays code
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
        <div className = "wizardPane-box1">
              <div>
                  <i className="fa fa-envelope-o fa-3x"></i>
              </div>
              <div>
                <Row>
                  <Col md={12}>
                      <FormGroup>
                         <ControlLabel className='subheading'>Email</ControlLabel>
                        <FormControl
                          type="text"
                          value     = {this.state.email}
                          onChange  = {(evt) => this.onUpdate('email', evt.currentTarget.value)}
                          placeholder="Organisation Name"
                        />
                        </FormGroup>
878ca8a15   Deepak   added signup form...
58
                  </Col>
dc0d0c739   Deepak   merged Ajays code
59
                </Row>
878ca8a15   Deepak   added signup form...
60
              </div>
dc0d0c739   Deepak   merged Ajays code
61
62
63
          <div className = "wizardPane-sectionD wizardPane-footer">
            <Button type="submit" onClick   = {() => this.onSetEmail()} className='blue'>Verify Now</Button>
            {/* <Button type="submit" onClick   = {() => this.onSetEmail()} className='blue'>Sign Up</Button> */}
878ca8a15   Deepak   added signup form...
64
65
66
67
68
69
70
71
72
73
          </div>
        </div>
      );
    };
  
    renderMessage() {
      const {user} = this.props;
  
      return (
        <div className = "wizardPane-box">
db3748612   ajaiprakash   Verify Email styling
74
          <div className = "wizardPane-section1">
878ca8a15   Deepak   added signup form...
75
76
  
            <div className = "wizardPane-title">
8ce8e66f3   ajaiprakash   Emailpane styling
77
            {/* <i className="icon-envelope icon"></i> */}
dc0d0c739   Deepak   merged Ajays code
78
79
80
             <h3>Hi, your email needs verification</h3>
  
              <span>Please check your email – we sent a verification link to &nbsp;
8ce8e66f3   ajaiprakash   Emailpane styling
81
              <span className = "EmailVerify">
dc0d0c739   Deepak   merged Ajays code
82
              {user.emails[0].address}</span></span>
878ca8a15   Deepak   added signup form...
83
84
            </div>
          </div>
8ce8e66f3   ajaiprakash   Emailpane styling
85
          <div className = "wizardPane-sectionD wizardPane-footer">
878ca8a15   Deepak   added signup form...
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
            <div className="btn"
              className = "wizardPane-link"
              onClick   = {() => this.onShowForm()}
            >
              Email did not arrive or want to use a different email?
            </div>
          </div>
        </div>
      );
    };
  
    render() {
      return this.state.form ? this.renderForm() : this.renderMessage();
    };
  
  };