Created
June 4, 2015 14:55
-
-
Save sergiors/992db803555699a56cfa to your computer and use it in GitHub Desktop.
modal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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