2019-09-26 12:07:11 -04:00
|
|
|
import * as PAGES from 'constants/pages';
|
2017-12-21 18:08:54 -03:00
|
|
|
import { connect } from 'react-redux';
|
2018-10-29 13:23:53 -04:00
|
|
|
import { doHideModal } from 'redux/actions/app';
|
2019-04-04 18:23:12 -04:00
|
|
|
import { withRouter } from 'react-router-dom';
|
2017-12-21 18:08:54 -03:00
|
|
|
import ModalRewardApprovalRequired from './view';
|
2017-08-25 23:21:26 -04:00
|
|
|
|
2019-04-04 18:23:12 -04:00
|
|
|
const perform = (dispatch, ownProps) => ({
|
2017-08-25 23:21:26 -04:00
|
|
|
doAuth: () => {
|
2019-04-04 18:23:12 -04:00
|
|
|
const {
|
|
|
|
|
location: { pathname },
|
|
|
|
|
history,
|
|
|
|
|
} = ownProps;
|
|
|
|
|
const currentPath = pathname.split('/$/')[1];
|
2018-10-29 13:23:53 -04:00
|
|
|
dispatch(doHideModal());
|
2019-09-26 12:07:11 -04:00
|
|
|
history.push(`/$/${PAGES.AUTH}?redirect=${currentPath}`);
|
2017-08-25 23:21:26 -04:00
|
|
|
},
|
2018-10-29 13:23:53 -04:00
|
|
|
closeModal: () => dispatch(doHideModal()),
|
2017-08-25 23:21:26 -04:00
|
|
|
});
|
|
|
|
|
|
2019-04-04 18:23:12 -04:00
|
|
|
export default withRouter(
|
|
|
|
|
connect(
|
|
|
|
|
null,
|
|
|
|
|
perform
|
|
|
|
|
)(ModalRewardApprovalRequired)
|
|
|
|
|
);
|