2017-12-21 18:08:54 -03:00
|
|
|
import { connect } from 'react-redux';
|
2020-05-25 13:20:45 -04:00
|
|
|
import { doPlayUri, doSetPlayingUri, doSetFloatingUri } from 'redux/actions/content';
|
2020-05-22 15:09:32 -04:00
|
|
|
import { selectPlayingUri } from 'redux/selectors/content';
|
2020-05-21 11:38:28 -04:00
|
|
|
import { doHideModal, doAnaltyicsPurchaseEvent } from 'redux/actions/app';
|
2018-10-29 13:23:53 -04:00
|
|
|
import { makeSelectMetadataForUri } from 'lbry-redux';
|
2017-12-21 18:08:54 -03:00
|
|
|
import ModalAffirmPurchase from './view';
|
2017-09-07 17:18:33 -04:00
|
|
|
|
2017-09-07 23:15:05 -04:00
|
|
|
const select = (state, props) => ({
|
|
|
|
metadata: makeSelectMetadataForUri(props.uri)(state),
|
2020-05-22 15:09:32 -04:00
|
|
|
playingUri: selectPlayingUri(state),
|
2017-09-07 17:18:33 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
const perform = dispatch => ({
|
2020-05-21 11:38:28 -04:00
|
|
|
analyticsPurchaseEvent: fileInfo => dispatch(doAnaltyicsPurchaseEvent(fileInfo)),
|
2020-05-22 15:09:32 -04:00
|
|
|
setPlayingUri: uri => dispatch(doSetPlayingUri(uri)),
|
2020-05-25 13:20:45 -04:00
|
|
|
setFloatingUri: uri => dispatch(doSetFloatingUri(uri)),
|
2018-10-29 13:23:53 -04:00
|
|
|
closeModal: () => dispatch(doHideModal()),
|
2020-05-21 11:38:28 -04:00
|
|
|
loadVideo: (uri, onSuccess) => dispatch(doPlayUri(uri, true, undefined, onSuccess)),
|
2017-09-07 17:18:33 -04:00
|
|
|
});
|
|
|
|
|
2020-05-21 11:38:28 -04:00
|
|
|
export default connect(select, perform)(ModalAffirmPurchase);
|