|
|
@ -13,15 +13,22 @@ class ConfirmationModal extends React.PureComponent { |
|
|
|
onConfirm: PropTypes.func.isRequired, |
|
|
|
secondary: PropTypes.string, |
|
|
|
onSecondary: PropTypes.func, |
|
|
|
closeWhenConfirm: PropTypes.bool, |
|
|
|
intl: PropTypes.object.isRequired, |
|
|
|
}; |
|
|
|
|
|
|
|
static defaultProps = { |
|
|
|
closeWhenConfirm: true, |
|
|
|
}; |
|
|
|
|
|
|
|
componentDidMount() { |
|
|
|
this.button.focus(); |
|
|
|
} |
|
|
|
|
|
|
|
handleClick = () => { |
|
|
|
this.props.onClose(); |
|
|
|
if (this.props.closeWhenConfirm) { |
|
|
|
this.props.onClose(); |
|
|
|
} |
|
|
|
this.props.onConfirm(); |
|
|
|
} |
|
|
|
|
|
|
|