mirror of
https://github.com/LBRYFoundation/lbry-android.git
synced 2025-08-28 07:51:25 +00:00
25 lines
No EOL
944 B
JavaScript
25 lines
No EOL
944 B
JavaScript
import { connect } from 'react-redux';
|
|
import {
|
|
doPurchaseUri,
|
|
makeSelectFileInfoForUri,
|
|
makeSelectDownloadingForUri,
|
|
makeSelectLoadingForUri,
|
|
} from 'lbry-redux';
|
|
import { doFetchCostInfoForUri, makeSelectCostInfoForUri } from 'lbryinc';
|
|
import { doStartDownload } from 'redux/actions/file';
|
|
import FileDownloadButton from './view';
|
|
|
|
const select = (state, props) => ({
|
|
fileInfo: makeSelectFileInfoForUri(props.uri)(state),
|
|
downloading: makeSelectDownloadingForUri(props.uri)(state),
|
|
costInfo: makeSelectCostInfoForUri(props.uri)(state),
|
|
loading: makeSelectLoadingForUri(props.uri)(state),
|
|
});
|
|
|
|
const perform = dispatch => ({
|
|
purchaseUri: (uri, costInfo, saveFile) => dispatch(doPurchaseUri(uri, costInfo, saveFile)),
|
|
restartDownload: (uri, outpoint) => dispatch(doStartDownload(uri, outpoint)),
|
|
fetchCostInfo: uri => dispatch(doFetchCostInfoForUri(uri)),
|
|
});
|
|
|
|
export default connect(select, perform)(FileDownloadButton); |