import React from 'react';
import { Modal, Button, Popover, Tooltip, OverlayTrigger} from 'react-bootstrap';
import { BrowserRouter, Route, Link, Redirect } from 'react-router-dom';

export class SignUp extends React.Component {

  constructor(props) {
    console.log("SignUp constructor");
    super(props);
    this.close = this.close.bind(this);
    this.state = {show: true};
  }

  close() {
    this.setState({show: false});
  }

  componentWillUnmount() {
    console.log('will unmount');
  }

  render() {
    if (!this.state.show) {
      return <Redirect to="/" />
    }

    const popover = (
      <Popover id="modal-popover" title="popover">
        very popover. such engagement
      </Popover>
    );

    const tooltip = (
      <Tooltip id="modal-tooltip">
        wow.
      </Tooltip>
    );

    return (
      <div>
        <Modal show={this.state.show} onHide={this.close}>
          <Modal.Header closeButton>
            <Modal.Title>Modal heading</Modal.Title>
          </Modal.Header>
          <Modal.Body>
            <h4>Text in a modal</h4>
            <p>Duis mollis, est non commodo luctus, nisi erat porttitor ligula.</p>

            <h4>Popover in a modal</h4>
            <p>there is a <OverlayTrigger overlay={popover}><a href="#">popover</a></OverlayTrigger> here</p>

            <h4>Tooltips in a modal</h4>
            <p>there is a <OverlayTrigger overlay={tooltip}><a href="#">tooltip</a></OverlayTrigger> here</p>

            <hr />

            <h4>Overflowing text to show scroll behavior</h4>
            <p>Sign Up Now</p>
          </Modal.Body>
          <Modal.Footer>
            <Button type="button" onClick={this.close}>Close</Button>
          </Modal.Footer>
        </Modal>
      </div>
    )
  }
}


@@ -28,16 +28,59 @@
 import %7B
+ Col, Form, FormControl, FormGroup, Navbar,
  Modal, 
@@ -148,81 +148,8 @@
 ap';
-%0Aimport %7B BrowserRouter, Route, Link, Redirect %7D from 'react-router-dom';
 %0A%0Aex
@@ -220,47 +220,8 @@
 ) %7B%0A
-    console.log(%22SignUp constructor%22);%0A
     
@@ -270,24 +270,66 @@
 bind(this);%0A
+    this.signup = this.signup.bind(this);%0A
     this.sta
@@ -409,28 +409,14 @@
 %0A%0A  
-componentWillUnmount
+signup
 () %7B
@@ -437,19 +437,20 @@
 og('
-will unmoun
+signup submi
 t');
@@ -506,271 +506,42 @@
     
-return %3CRedirect to=%22/%22 /%3E%0A    %7D%0A%0A    const popover = (%0A      %3CPopover id=%22modal-popover%22 title=%22popover%22%3E%0A        very popover. such engagement%0A      %3C/Popover%3E%0A    );%0A%0A    const tooltip = (%0A      %3CTooltip id=%22modal-tooltip%22%3E%0A        wow.%0A      %3C/Tooltip%3E%0A    );
+this.props.history.goBack();%0A    %7D
 %0A%0A  
@@ -555,22 +555,8 @@
 n (%0A
-      %3Cdiv%3E%0A  
     
@@ -612,26 +612,24 @@
 e%7D%3E%0A        
-  
 %3CModal.Heade
@@ -635,34 +635,32 @@
 er closeButton%3E%0A
-  
           %3CModal
@@ -670,21 +670,19 @@
 tle%3E
-Modal heading
+New Account
 %3C/Mo
@@ -692,18 +692,16 @@
 .Title%3E%0A
-  
         
@@ -712,26 +712,24 @@
 dal.Header%3E%0A
-  
         %3CMod
@@ -751,585 +751,513 @@
     
-  %3Ch4%3EText in a modal%3C/h4%3E%0A            %3Cp%3EDuis mollis, est non commodo luctus, nisi erat porttitor ligula.%3C/p%3E%0A%0A            %3Ch4%3EPopover in a modal%3C/h4%3E%0A            %3Cp%3Ethere is a %3COverlayTrigger overlay=%7Bpopover%7D%3E%3Ca href=%22#%22%3Epopover%3C/a%3E%3C/OverlayTrigger%3E here%3C/p%3E%0A%0A            %3Ch4%3ETooltips in a modal%3C/h4%3E%0A            %3Cp%3Ethere is a %3COverlayTrigger overlay=%7Btooltip%7D%3E%3Ca href=%22#%22%3Etooltip%3C/a%3E%3C/OverlayTrigger%3E here%3C/p%3E%0A%0A            %3Chr /%3E%0A%0A            %3Ch4%3EOverflowing text to show scroll behavior%3C/h4%3E%0A            %3Cp%3ESign Up Now%3C/p%3E%0A          %3C/Modal.Body%3E%0A          %3CModal.Footer%3E%0A
+%3CNavbar.Form%3E%0A            %3CForm horizontal onSubmit=%7Bthis.signup%7D%3E%0A              %3CFormGroup%3E%0A                %3CCol sm=%7B10%7D%3E%0A                  %3CFormControl type=%22text%22 placeholder=%22Email%22 ref=%22email%22 /%3E%0A                %3C/Col%3E%0A              %3C/FormGroup%3E%0A              %3CFormGroup%3E%0A                %3CCol sm=%7B10%7D%3E%0A                  %3CFormControl type=%22password%22 placeholder=%22Password%22 ref=%22password%22 /%3E%0A                %3C/Col%3E%0A              %3C/FormGroup%3E%0A              %3CFormGroup%3E%0A                %3CCol sm=%7B10%7D%3E%0A    
     
@@ -1264,16 +1264,18 @@
         
+  
 %3CButton 
@@ -1284,76 +1284,125 @@
 pe=%22
-button%22 onClick=%7Bthis.close%7D%3EClose%3C/Button%3E%0A          %3C/Modal.Footer
+submit%22%3ESubmit%3C/Button%3E%0A                %3C/Col%3E%0A              %3C/FormGroup%3E%0A            %3C/Form%3E%0A          %3C/Navbar.Form
 %3E%0A  
@@ -1414,16 +1414,21 @@
  %3C/Modal
+.Body
 %3E%0A      
@@ -1433,11 +1433,13 @@
   %3C/
-div
+Modal
 %3E%0A  

Use history.goBack() instead of Redirect