Sha256: 6d6541ee96d090d24fbb1314ed7f4f30da2aa081168f49c561f4ee329af0330a
Contents?: true
Size: 859 Bytes
Versions: 6
Compression:
Stored size: 859 Bytes
Contents
Rev.registerComponent('Modal', class extends React.Component { constructor(props) { super(props) this.onBackgroundClick = this.onBackgroundClick.bind(this) } static get propTypes() { return { isOpen: React.PropTypes.bool, onBackgroundClick: React.PropTypes.func, } } static get defaultProps() { return { isOpen: false, } } onBackgroundClick(e) { if(this.props.onBackgroundClick) { this.props.onBackgroundClick(e) } } render() { let className = this.classAdd({ 'RevModal': true, }) if(this.props.isOpen) { return <div className={className}> <div className="RevModal-background" onClick={this.onBackgroundClick} /> <div className="RevModal-content"> {this.props.children} </div> </div> } return null } })
Version data entries
6 entries across 6 versions & 1 rubygems