lbry-desktop/ui/js/component/filePrice/index.js

28 lines
829 B
JavaScript
Raw Normal View History

2017-06-06 23:19:12 +02:00
import React from "react";
import { connect } from "react-redux";
import { doFetchCostInfoForUri } from "actions/cost_info";
import {
makeSelectCostInfoForUri,
makeSelectFetchingCostInfoForUri,
2017-06-06 23:19:12 +02:00
} from "selectors/cost_info";
import FilePrice from "./view";
const makeSelect = () => {
2017-06-06 23:19:12 +02:00
const selectCostInfoForUri = makeSelectCostInfoForUri();
const selectFetchingCostInfoForUri = makeSelectFetchingCostInfoForUri();
const select = (state, props) => ({
costInfo: selectCostInfoForUri(state, props),
fetching: selectFetchingCostInfoForUri(state, props),
2017-06-06 23:19:12 +02:00
});
2017-06-06 23:19:12 +02:00
return select;
2017-06-06 06:21:55 +02:00
};
2017-06-06 06:21:55 +02:00
const perform = dispatch => ({
2017-06-06 23:19:12 +02:00
fetchCostInfo: uri => dispatch(doFetchCostInfoForUri(uri)),
// cancelFetchCostInfo: (uri) => dispatch(doCancelFetchCostInfoForUri(uri))
2017-06-06 06:21:55 +02:00
});
2017-06-06 06:21:55 +02:00
export default connect(makeSelect, perform)(FilePrice);