react-semantify
react-semantify copied to clipboard
Toggle modal visibility by passing attribute
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>
)
}
};