lbry-desktop/ui/modal/modalAffirmPurchase/index.js

21 lines
850 B
JavaScript
Raw Normal View History

import { connect } from 'react-redux';
import { doPlayUri, doSetPlayingUri } from 'redux/actions/content';
import { selectPlayingUri } from 'redux/selectors/content';
2020-05-21 17:38:28 +02:00
import { doHideModal, doAnaltyicsPurchaseEvent } from 'redux/actions/app';
import { makeSelectMetadataForUri } from 'lbry-redux';
import ModalAffirmPurchase from './view';
2017-09-07 23:18:33 +02:00
2017-09-08 05:15:05 +02:00
const select = (state, props) => ({
metadata: makeSelectMetadataForUri(props.uri)(state),
playingUri: selectPlayingUri(state),
2017-09-07 23:18:33 +02:00
});
const perform = dispatch => ({
2020-05-21 17:38:28 +02:00
analyticsPurchaseEvent: fileInfo => dispatch(doAnaltyicsPurchaseEvent(fileInfo)),
setPlayingUri: uri => dispatch(doSetPlayingUri({ uri })),
closeModal: () => dispatch(doHideModal()),
2020-05-21 17:38:28 +02:00
loadVideo: (uri, onSuccess) => dispatch(doPlayUri(uri, true, undefined, onSuccess)),
2017-09-07 23:18:33 +02:00
});
2020-05-21 17:38:28 +02:00
export default connect(select, perform)(ModalAffirmPurchase);