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

25 lines
605 B
JavaScript
Raw Normal View History

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-04-05 00:23:12 +02:00
history.push(`/$/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)
);