Added onCancel function prop to confirmation_modal
Added an optional function to call on confirmation modal
This commit is contained in:
parent
8aeeaa7244
commit
efd441d0ba
@ -14,6 +14,7 @@ class ConfirmationModal extends React.PureComponent {
|
|||||||
secondary: PropTypes.string,
|
secondary: PropTypes.string,
|
||||||
onSecondary: PropTypes.func,
|
onSecondary: PropTypes.func,
|
||||||
intl: PropTypes.object.isRequired,
|
intl: PropTypes.object.isRequired,
|
||||||
|
onCancel: PropTypes.func,
|
||||||
};
|
};
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
@ -31,7 +32,9 @@ class ConfirmationModal extends React.PureComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
handleCancel = () => {
|
handleCancel = () => {
|
||||||
this.props.onClose();
|
const {onClose, onCancel} = this.props;
|
||||||
|
onClose();
|
||||||
|
if (onCancel) onCancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
setRef = (c) => {
|
setRef = (c) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user