2019-06-28 09:27:55 +02:00
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import {
|
|
|
|
doResolveUri,
|
|
|
|
makeSelectClaimForUri,
|
|
|
|
makeSelectIsUriResolving,
|
|
|
|
makeSelectClaimIsMine,
|
|
|
|
makeSelectClaimIsPending,
|
|
|
|
makeSelectThumbnailForUri,
|
|
|
|
makeSelectTitleForUri,
|
|
|
|
makeSelectClaimIsNsfw,
|
2019-07-08 22:54:58 +02:00
|
|
|
selectBlockedChannels,
|
|
|
|
selectChannelIsBlocked,
|
2019-06-28 09:27:55 +02:00
|
|
|
} from 'lbry-redux';
|
2019-07-17 05:32:29 +02:00
|
|
|
import { selectBlackListedOutpoints, selectFilteredOutpoints } from 'lbryinc';
|
2019-08-02 08:28:14 +02:00
|
|
|
import { selectShowMatureContent } from 'redux/selectors/settings';
|
2019-07-11 20:06:25 +02:00
|
|
|
import { makeSelectHasVisitedUri } from 'redux/selectors/content';
|
2019-07-08 22:54:58 +02:00
|
|
|
import { makeSelectIsSubscribed } from 'redux/selectors/subscriptions';
|
2019-06-28 09:27:55 +02:00
|
|
|
import ClaimPreview from './view';
|
|
|
|
|
|
|
|
const select = (state, props) => ({
|
|
|
|
pending: makeSelectClaimIsPending(props.uri)(state),
|
|
|
|
claim: makeSelectClaimForUri(props.uri)(state),
|
2019-08-02 08:28:14 +02:00
|
|
|
obscureNsfw: !selectShowMatureContent(state),
|
2019-06-28 09:27:55 +02:00
|
|
|
claimIsMine: makeSelectClaimIsMine(props.uri)(state),
|
|
|
|
isResolvingUri: makeSelectIsUriResolving(props.uri)(state),
|
|
|
|
thumbnail: makeSelectThumbnailForUri(props.uri)(state),
|
|
|
|
title: makeSelectTitleForUri(props.uri)(state),
|
|
|
|
nsfw: makeSelectClaimIsNsfw(props.uri)(state),
|
|
|
|
blackListedOutpoints: selectBlackListedOutpoints(state),
|
2019-07-17 05:32:29 +02:00
|
|
|
filteredOutpoints: selectFilteredOutpoints(state),
|
2019-07-08 22:54:58 +02:00
|
|
|
blockedChannelUris: selectBlockedChannels(state),
|
2019-07-11 20:06:25 +02:00
|
|
|
hasVisitedUri: makeSelectHasVisitedUri(props.uri)(state),
|
2019-07-08 22:54:58 +02:00
|
|
|
channelIsBlocked: selectChannelIsBlocked(props.uri)(state),
|
|
|
|
isSubscribed: makeSelectIsSubscribed(props.uri, true)(state),
|
2019-06-28 09:27:55 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
const perform = dispatch => ({
|
|
|
|
resolveUri: uri => dispatch(doResolveUri(uri)),
|
|
|
|
});
|
|
|
|
|
|
|
|
export default connect(
|
|
|
|
select,
|
|
|
|
perform
|
|
|
|
)(ClaimPreview);
|