2015-09-09 22:15:16 -04:00
|
|
|
var React = require('react');
|
2015-10-08 16:18:12 -04:00
|
|
|
var ReactModal = require('react-modal');
|
2015-09-09 22:15:16 -04:00
|
|
|
|
|
|
|
require('./modal.scss');
|
|
|
|
|
|
|
|
|
2015-10-08 16:18:12 -04:00
|
|
|
var Modal = React.createClass({
|
2015-10-09 16:16:37 -04:00
|
|
|
type: 'Modal',
|
2015-09-09 22:15:16 -04:00
|
|
|
statics: {
|
2015-10-08 16:18:12 -04:00
|
|
|
setAppElement: ReactModal.setAppElement
|
2015-09-09 22:15:16 -04:00
|
|
|
},
|
2015-09-10 15:00:07 -04:00
|
|
|
requestClose: function () {
|
2015-09-09 22:15:16 -04:00
|
|
|
return this.refs.modal.portal.requestClose();
|
|
|
|
},
|
2015-09-10 15:00:07 -04:00
|
|
|
render: function () {
|
2015-09-09 22:15:16 -04:00
|
|
|
return (
|
2015-10-08 16:18:12 -04:00
|
|
|
<ReactModal ref="modal" {... this.props}>
|
2015-09-11 09:43:10 -04:00
|
|
|
<div className="modal-close" onClick={this.requestClose}></div>
|
2015-09-09 22:15:16 -04:00
|
|
|
{this.props.children}
|
2015-10-08 16:18:12 -04:00
|
|
|
</ReactModal>
|
2015-09-09 22:15:16 -04:00
|
|
|
);
|
|
|
|
}
|
|
|
|
});
|
2015-10-08 16:18:12 -04:00
|
|
|
|
|
|
|
module.exports = Modal;
|