import React, {Component} from 'react'; import Modal from '../base/Modal'; import ModalBody from '../base/ModalBody'; import ModalHeader from '../base/ModalHeader'; import ModalFooter from '../base/ModalFooter'; class AlertModal extends Component { constructor (props) { super(props); this.state = {}; } show ({headerName, message}) { this.modal.show(); this.setState({headerName, message}); Mousetrap.bindGlobal('enter', () => this.modal.hide()); } render () { const {extraProps} = this.props; const {message, headerName} = this.state; return ( this.modal = m} {...extraProps}> {headerName || 'Uh Oh!'} {message} ) } } AlertModal.propTypes = {}; export default AlertModal;