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

Version Path
revelry_core-0.1.24.0 app/assets/javascripts/revelry/examples/Modals.es6
revelry_core-0.1.23.0 app/assets/javascripts/revelry/examples/Modals.es6
revelry_core-0.1.22.0 app/assets/javascripts/revelry/examples/Modals.es6
revelry_core-0.1.21.0 app/assets/javascripts/revelry/examples/Modals.es6
revelry_core-0.1.20.0 app/assets/javascripts/revelry/examples/Modals.es6
revelry_core-0.1.19.0 app/assets/javascripts/revelry/examples/Modals.es6
revelry_core-0.1.18.0 app/assets/javascripts/revelry/examples/Modals.es6
revelry_core-0.1.17.0 app/assets/javascripts/revelry/examples/Modals.es6
revelry_core-0.1.16.0 app/assets/javascripts/revelry/examples/Modals.es6
revelry_core-0.1.15.0 app/assets/javascripts/revelry/examples/Modals.es6
revelry_core-0.1.14.0 app/assets/javascripts/revelry/examples/Modals.es6
revelry_core-0.1.13.0 app/assets/javascripts/revelry/examples/Modals.es6