Skip to content

Instantly share code, notes, and snippets.

@sergiors
Created June 4, 2015 14:55
Show Gist options
  • Save sergiors/992db803555699a56cfa to your computer and use it in GitHub Desktop.
Save sergiors/992db803555699a56cfa to your computer and use it in GitHub Desktop.
modal
define(function(require) {
'use strict';
var React = require('react');
var dom = React.DOM;
return React.createClass({
propTypes: {
onClose: React.PropTypes.func.isRequired
},
render: function() {
return (
dom.div({},
dom.div({className: 'reveal-modal-bg', onClick: this.onClose}, null),
dom.div({className: 'reveal-modal'},
dom.a({className: 'close-reveal-modal', onClick: this.onClose}, '×'),
this.props.children
)
)
);
},
onClose: function(e) {
e.preventDefault();
this.props.onClose();
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment