mirror of
https://github.com/Kong/insomnia
synced 2024-11-08 23:00:30 +00:00
e380a4d2b1
* Payment modal done * Refactor settings and added command support * Made sync operations more efficient * Sync button slightly more efficient * Remove Elm * Fixed Codemirror * Nunjucks 3.0 * Revert sourcemap change and some renaming * Some fixes for Config creation, and added name to resources * Set to new Insomnia URL * Some fixes
41 lines
964 B
JavaScript
41 lines
964 B
JavaScript
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 ({title, message}) {
|
|
this.modal.show();
|
|
this.setState({title, message});
|
|
}
|
|
|
|
render () {
|
|
const {extraProps} = this.props;
|
|
const {message, title} = this.state;
|
|
|
|
return (
|
|
<Modal ref={m => this.modal = m} closeOnKeyCodes={[13]} {...extraProps}>
|
|
<ModalHeader>{title || 'Uh Oh!'}</ModalHeader>
|
|
<ModalBody className="wide pad">
|
|
{message}
|
|
</ModalBody>
|
|
<ModalFooter>
|
|
<button className="btn" onClick={e => this.modal.hide()}>
|
|
Ok
|
|
</button>
|
|
</ModalFooter>
|
|
</Modal>
|
|
)
|
|
}
|
|
}
|
|
|
|
AlertModal.propTypes = {};
|
|
|
|
export default AlertModal;
|