scratch-www/src/components/modal/modal.jsx
2015-10-09 14:16:37 -06:00

25 lines
600 B
JavaScript

var React = require('react');
var ReactModal = require('react-modal');
require('./modal.scss');
var Modal = React.createClass({
type: 'Modal',
statics: {
setAppElement: ReactModal.setAppElement
},
requestClose: function () {
return this.refs.modal.portal.requestClose();
},
render: function () {
return (
<ReactModal ref="modal" {... this.props}>
<div className="modal-close" onClick={this.requestClose}></div>
{this.props.children}
</ReactModal>
);
}
});
module.exports = Modal;