2017-12-21 22:08:54 +01:00
|
|
|
import { connect } from 'react-redux';
|
2020-10-20 19:10:02 +02:00
|
|
|
import { doPlayUri, doSetPlayingUri } from 'redux/actions/content';
|
2020-05-22 21:09:32 +02:00
|
|
|
import { selectPlayingUri } from 'redux/selectors/content';
|
2020-05-21 17:38:28 +02:00
|
|
|
import { doHideModal, doAnaltyicsPurchaseEvent } from 'redux/actions/app';
|
2021-10-08 05:47:39 +02:00
|
|
|
import { makeSelectMetadataForUri } from 'redux/selectors/claims';
|
2017-12-21 22:08:54 +01:00
|
|
|
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),
|
2020-05-22 21:09:32 +02:00
|
|
|
playingUri: selectPlayingUri(state),
|
2017-09-07 23:18:33 +02:00
|
|
|
});
|
|
|
|
|
2021-10-08 05:47:39 +02:00
|
|
|
const perform = (dispatch) => ({
|
|
|
|
analyticsPurchaseEvent: (fileInfo) => dispatch(doAnaltyicsPurchaseEvent(fileInfo)),
|
|
|
|
setPlayingUri: (uri) => dispatch(doSetPlayingUri({ uri })),
|
2018-10-29 18:23:53 +01:00
|
|
|
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);
|