2017-12-21 18:08:54 -03:00
|
|
|
import { connect } from 'react-redux';
|
2019-08-02 17:03:26 -04:00
|
|
|
import { doSetPlayingUri, doPlayUri } from 'redux/actions/content';
|
2018-10-29 13:23:53 -04:00
|
|
|
import { doHideModal } from 'redux/actions/app';
|
|
|
|
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),
|
2017-09-07 17:18:33 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
const perform = dispatch => ({
|
2017-09-17 22:08:43 -04:00
|
|
|
cancelPurchase: () => {
|
|
|
|
dispatch(doSetPlayingUri(null));
|
2018-10-29 13:23:53 -04:00
|
|
|
dispatch(doHideModal());
|
2017-09-17 22:08:43 -04:00
|
|
|
},
|
2018-10-29 13:23:53 -04:00
|
|
|
closeModal: () => dispatch(doHideModal()),
|
2019-08-13 01:35:13 -04:00
|
|
|
loadVideo: uri => {
|
|
|
|
dispatch(doSetPlayingUri(uri));
|
|
|
|
dispatch(doPlayUri(uri, true));
|
|
|
|
},
|
2017-09-07 17:18:33 -04:00
|
|
|
});
|
|
|
|
|
2018-11-01 22:55:25 +01:00
|
|
|
export default connect(
|
|
|
|
select,
|
|
|
|
perform
|
|
|
|
)(ModalAffirmPurchase);
|