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

35 lines
1.1 KiB
JavaScript
Raw Normal View History

2020-01-20 17:47:03 +01:00
import { connect } from 'react-redux';
import {
doResolveUri,
makeSelectClaimForUri,
makeSelectIsUriResolving,
makeSelectThumbnailForUri,
makeSelectTitleForUri,
doFileGet,
makeSelectChannelForClaimUri,
2020-01-20 19:55:28 +01:00
selectBlockedChannels,
2020-01-20 17:47:03 +01:00
} from 'lbry-redux';
import { selectBlackListedOutpoints, selectFilteredOutpoints } from 'lbryinc';
import ClaimPreviewTile from './view';
const select = (state, props) => ({
claim: props.uri && makeSelectClaimForUri(props.uri)(state),
channel: props.uri && makeSelectChannelForClaimUri(props.uri)(state),
isResolvingUri: props.uri && makeSelectIsUriResolving(props.uri)(state),
thumbnail: props.uri && makeSelectThumbnailForUri(props.uri)(state),
title: props.uri && makeSelectTitleForUri(props.uri)(state),
blackListedOutpoints: selectBlackListedOutpoints(state),
filteredOutpoints: selectFilteredOutpoints(state),
2020-01-20 19:55:28 +01:00
blockedChannelUris: selectBlockedChannels(state),
2020-01-20 17:47:03 +01:00
});
const perform = dispatch => ({
resolveUri: uri => dispatch(doResolveUri(uri)),
getFile: uri => dispatch(doFileGet(uri, false)),
});
export default connect(
select,
perform
)(ClaimPreviewTile);