lbry-desktop/src/ui/modal/modalRewardApprovalRequired/index.js

26 lines
656 B
JavaScript
Raw Normal View History

2019-09-26 18:07:11 +02:00
import * as PAGES from 'constants/pages';
import { connect } from 'react-redux';
import { doHideModal } from 'redux/actions/app';
2019-04-05 00:23:12 +02:00
import { withRouter } from 'react-router-dom';
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];
dispatch(doHideModal());
2019-09-26 18:07:11 +02:00
history.push(`/$/${PAGES.AUTH}?redirect=${currentPath}`);
2017-08-26 05:21:26 +02: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)
);