Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Toggle modal visibility by passing attribute #72

Open
pgol opened this issue Aug 17, 2016 · 0 comments
Open

Toggle modal visibility by passing attribute #72

pgol opened this issue Aug 17, 2016 · 0 comments

Comments

@pgol
Copy link

pgol commented Aug 17, 2016

How can I toggle modal visibility by passing attribute ? I want to have this modal and toggle visibility by passing this.props.show

import {Component} from 'react';
import {Modal} from 'react-semantify';


export default class DeleteModal extends Component {
  componentWillMount() {
    $('.ui.deleteModal')
      .modal()
      .modal({
        onApprove: () => this.props.onDelete(),
        onDeny: () => this.props.onDeny()
      });
  }
  render() {
    return (
      <Modal init={this.props.show} className="small ui deleteModal">
        <i className="close icon"></i>
        <div className="content">
          <div className="ui header aligned center">
            Some messsage?
          </div>
        </div>
        <div className="actions buttons aligned center">
          <div className="ui basic deny button">
            No
          </div>
          <div className="ui positive blue right button">
            Yes
          </div>
        </div>
      </Modal>
    )
  }
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant