Sha256: d4a97df332d5ead8976aa2b3e75f2f485947cdfd925281da2b97c004947090c9
Contents?: true
Size: 932 Bytes
Versions: 12
Compression:
Stored size: 932 Bytes
Contents
Rev.registerExample('Modals', class ModalsExample extends React.Component { constructor(props) { super(props) this.state = { modalShow: false, } } showModal(e) { e.preventDefault() this.setState({ modalShow: true, }) } closeModal(e) { this.setState({ modalShow: false, }) } render() { const {Modal, Button, Lipsum} = Rev.Components return ( <div> <h3>{"<Modal>"}</h3> <Button small onClick={this.showModal.bind(this)}>Click to Open</Button> <Modal isOpen={this.state.modalShow} onBackgroundClick={this.closeModal.bind(this)} > <h1 className="RevModalHeader">This is a modal</h1> <p><Lipsum /></p> <Button small onClick={this.closeModal.bind(this)}> Click this button or background to close. </Button> </Modal> </div> ) } })
Version data entries
12 entries across 12 versions & 1 rubygems