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

26 lines
600 B
React
Raw Normal View History

var React = require('react');
var ReactModal = require('react-modal');
require('./modal.scss');
var Modal = React.createClass({
2015-10-09 16:16:37 -04:00
type: 'Modal',
statics: {
setAppElement: ReactModal.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 (
<ReactModal ref="modal" {... this.props}>
2015-09-11 09:43:10 -04:00
<div className="modal-close" onClick={this.requestClose}></div>
{this.props.children}
</ReactModal>
);
}
});
module.exports = Modal;