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