2017-12-21 22:08:54 +01:00
|
|
|
import { connect } from 'react-redux';
|
2018-10-29 18:23:53 +01:00
|
|
|
import { doHideModal } from 'redux/actions/app';
|
2019-04-05 00:23:12 +02:00
|
|
|
import { withRouter } from 'react-router-dom';
|
2017-12-21 22:08:54 +01:00
|
|
|
import ModalRewardApprovalRequired from './view';
|
2017-08-26 05:21:26 +02:00
|
|
|
|
2019-04-05 00:23:12 +02:00
|
|
|
const perform = (dispatch, ownProps) => ({
|
2017-08-26 05:21:26 +02:00
|
|
|
doAuth: () => {
|
2019-04-05 00:23:12 +02:00
|
|
|
const {
|
|
|
|
location: { pathname },
|
|
|
|
history,
|
|
|
|
} = ownProps;
|
|
|
|
const currentPath = pathname.split('/$/')[1];
|
2018-10-29 18:23:53 +01:00
|
|
|
dispatch(doHideModal());
|
2019-04-05 00:23:12 +02:00
|
|
|
history.push(`/$/auth?redirect=${currentPath}`);
|
2017-08-26 05:21:26 +02:00
|
|
|
},
|
2018-10-29 18:23:53 +01:00
|
|
|
closeModal: () => dispatch(doHideModal()),
|
2017-08-26 05:21:26 +02:00
|
|
|
});
|
|
|
|
|
2019-04-05 00:23:12 +02:00
|
|
|
export default withRouter(
|
|
|
|
connect(
|
|
|
|
null,
|
|
|
|
perform
|
|
|
|
)(ModalRewardApprovalRequired)
|
|
|
|
);
|