mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2025-01-08 05:22:16 -05:00
23 lines
539 B
React
23 lines
539 B
React
|
var React = require('react');
|
||
|
var Modal = require('react-modal');
|
||
|
|
||
|
require('./modal.scss');
|
||
|
|
||
|
|
||
|
module.exports = React.createClass({
|
||
|
statics: {
|
||
|
setAppElement: Modal.setAppElement
|
||
|
},
|
||
|
requestClose: function() {
|
||
|
return this.refs.modal.portal.requestClose();
|
||
|
},
|
||
|
render: function() {
|
||
|
return (
|
||
|
<Modal ref='modal' {... this.props}>
|
||
|
<div className='modal-close' onClick={this.requestClose}></div>
|
||
|
{this.props.children}
|
||
|
</Modal>
|
||
|
);
|
||
|
}
|
||
|
});
|