Added onCancel function prop to confirmation_modal

Added an optional function to call on confirmation modal
This commit is contained in:
mgabdev 2019-07-22 23:02:14 -04:00
parent 8aeeaa7244
commit efd441d0ba

View File

@ -14,6 +14,7 @@ class ConfirmationModal extends React.PureComponent {
secondary: PropTypes.string,
onSecondary: PropTypes.func,
intl: PropTypes.object.isRequired,
onCancel: PropTypes.func,
};
componentDidMount() {
@ -31,7 +32,9 @@ class ConfirmationModal extends React.PureComponent {
}
handleCancel = () => {
this.props.onClose();
const {onClose, onCancel} = this.props;
onClose();
if (onCancel) onCancel();
}
setRef = (c) => {