lbry-desktop/src/renderer/modal/modalAffirmPurchase/index.js

22 lines
683 B
JavaScript
Raw Normal View History

2017-09-07 23:18:33 +02:00
import React from "react";
import { connect } from "react-redux";
2017-11-13 22:02:23 +01:00
import { doCloseModal } from "redux/actions/app";
import { doLoadVideo, doSetPlayingUri } from "redux/actions/content";
import { makeSelectMetadataForUri } from "redux/selectors/claims";
2017-09-07 23:18:33 +02:00
import ModalAffirmPurchase from "./view";
2017-09-08 05:15:05 +02:00
const select = (state, props) => ({
metadata: makeSelectMetadataForUri(props.uri)(state),
2017-09-07 23:18:33 +02:00
});
const perform = dispatch => ({
cancelPurchase: () => {
dispatch(doSetPlayingUri(null));
dispatch(doCloseModal());
},
2017-09-07 23:18:33 +02:00
closeModal: () => dispatch(doCloseModal()),
2017-09-08 05:15:05 +02:00
loadVideo: uri => dispatch(doLoadVideo(uri)),
2017-09-07 23:18:33 +02:00
});
export default connect(select, perform)(ModalAffirmPurchase);