scratch-www/src/components/modal/modal.jsx

23 lines
541 B
React
Raw Normal View History

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