mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2025-01-05 20:12:02 -05:00
25 lines
600 B
JavaScript
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;
|