import React, { Component } from 'react'; import PropTypes from 'prop-types'; import './SimpleDialog.styl'; class SimpleDialog extends Component { static propTypes = { children: PropTypes.node, componentRef: PropTypes.any, componentStyle: PropTypes.object, rootClass: PropTypes.string, isOpen: PropTypes.bool, headerTitle: PropTypes.string.isRequired, onClose: PropTypes.func.isRequired, onConfirm: PropTypes.func.isRequired, }; static defaultProps = { isOpen: true, componentStyle: {}, rootClass: '', }; render() { return ( {this.props.isOpen && (
x

{this.props.headerTitle}

{this.props.children}
)}
); } onClose = event => { event.preventDefault(); event.stopPropagation(); this.props.onClose(); }; onConfirm = event => { event.preventDefault(); event.stopPropagation(); this.props.onConfirm(); }; } export { SimpleDialog };