UnauthorizedModal: use withRouter history
This commit is contained in:
parent
228f16f930
commit
d34937e959
1 changed files with 3 additions and 6 deletions
|
@ -54,16 +54,13 @@ const mapDispatchToProps = dispatch => ({
|
||||||
@withRouter
|
@withRouter
|
||||||
class UnauthorizedModal extends ImmutablePureComponent {
|
class UnauthorizedModal extends ImmutablePureComponent {
|
||||||
|
|
||||||
static contextTypes = {
|
|
||||||
router: PropTypes.object.isRequired,
|
|
||||||
};
|
|
||||||
|
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
intl: PropTypes.object.isRequired,
|
intl: PropTypes.object.isRequired,
|
||||||
features: PropTypes.object.isRequired,
|
features: PropTypes.object.isRequired,
|
||||||
onClose: PropTypes.func.isRequired,
|
onClose: PropTypes.func.isRequired,
|
||||||
onRemoteInteraction: PropTypes.func.isRequired,
|
onRemoteInteraction: PropTypes.func.isRequired,
|
||||||
userName: PropTypes.string,
|
userName: PropTypes.string,
|
||||||
|
history: PropTypes.object.isRequired,
|
||||||
singleUserMode: PropTypes.bool,
|
singleUserMode: PropTypes.bool,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -100,14 +97,14 @@ class UnauthorizedModal extends ImmutablePureComponent {
|
||||||
onLogin = (e) => {
|
onLogin = (e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
this.context.router.history.push('/login');
|
this.props.history.push('/login');
|
||||||
this.onClickClose();
|
this.onClickClose();
|
||||||
}
|
}
|
||||||
|
|
||||||
onRegister = (e) => {
|
onRegister = (e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
this.context.router.history.push('/');
|
this.props.history.push('/');
|
||||||
this.onClickClose();
|
this.onClickClose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue