lbry-desktop/src/ui/modal/modalRewardApprovalRequired/index.js
2019-09-26 12:16:03 -04:00

26 lines
656 B
JavaScript

import * as PAGES from 'constants/pages';
import { connect } from 'react-redux';
import { doHideModal } from 'redux/actions/app';
import { withRouter } from 'react-router-dom';
import ModalRewardApprovalRequired from './view';
const perform = (dispatch, ownProps) => ({
doAuth: () => {
const {
location: { pathname },
history,
} = ownProps;
const currentPath = pathname.split('/$/')[1];
dispatch(doHideModal());
history.push(`/$/${PAGES.AUTH}?redirect=${currentPath}`);
},
closeModal: () => dispatch(doHideModal()),
});
export default withRouter(
connect(
null,
perform
)(ModalRewardApprovalRequired)
);