const React = require('react');
const {render} = require('react-dom');

const {
  Modal,
  ModalHeader,
  ModalTitle,
  ModalClose,
  ModalBody,
  ModalFooter,
  ModalActions
} = require('../../src/index');
const {
  GatewayDest,
  GatewayProvider
} = require('react-gateway');
const ReactModal2 = require('react-modal2');
const {Button} = require('cf-component-button');

class ComponentWithModal extends React.Component {
  state = {
    isModalOpen: false
  };

  handleRequestOpen = () => {
    this.setState({ isModalOpen: true });
  };

  handleRequestClose = () => {
    this.setState({ isModalOpen: false });
  };

  render() {
    return (
      <div>
        <Button onClick={this.handleRequestOpen}>Open Modal</Button>
        <Modal
          isOpen={this.state.isModalOpen}
          onRequestClose={this.handleRequestClose}>
          <ModalHeader>
            <ModalTitle>Hello from Modal</ModalTitle>
            <ModalClose onClick={this.handleRequestClose}/>
          </ModalHeader>
          <ModalBody>
            <p>Look at this awesome modal!</p>
          </ModalBody>
          <ModalFooter>
            <ModalActions>
              <button onClick={this.handleRequestClose.bind(this)}>Close Modal</button>
            </ModalActions>
          </ModalFooter>
        </Modal>
      </div>
    );
  }
}

class Component extends React.Component {
  render() {
    return (
      <GatewayProvider>
        <div>
          <div>
            <ComponentWithModal/>
          </div>
          <GatewayDest name="modal"/>
        </div>
      </GatewayProvider>
    );
  }
}

const root = document.getElementById('cf-component-modal--basic');

ReactModal2.getApplicationElement = () => root;

render(
  <Component/>,
  root
);

@@ -381,25 +381,16 @@
 omponent
-WithModal
  extends
@@ -1318,273 +1318,8 @@
 %0A%7D%0A%0A
-class Component extends React.Component %7B%0A  render() %7B%0A    return (%0A      %3CGatewayProvider%3E%0A        %3Cdiv%3E%0A          %3Cdiv%3E%0A            %3CComponentWithModal/%3E%0A          %3C/div%3E%0A          %3CGatewayDest name=%22modal%22/%3E%0A        %3C/div%3E%0A      %3C/GatewayProvider%3E%0A    );%0A  %7D%0A%7D%0A%0A
 cons

Fix react-gateway usage