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

25 lines
947 B
JavaScript
Raw Normal View History

import { connect } from 'react-redux';
import { makeSelectClaimForUri } from 'redux/selectors/claims';
import { doFetchRecommendedContent } from 'redux/actions/search';
2020-07-27 22:04:12 +02:00
import { makeSelectRecommendedContentForUri, selectIsSearching } from 'redux/selectors/search';
import { selectUserVerifiedEmail } from 'redux/selectors/user';
import RecommendedContent from './view';
const select = (state, props) => {
const claim = makeSelectClaimForUri(props.uri)(state);
const { claim_id: claimId } = claim;
const recommendedContentUris = makeSelectRecommendedContentForUri(props.uri)(state);
const nextRecommendedUri = recommendedContentUris && recommendedContentUris[0];
return {
claim,
claimId,
recommendedContentUris,
nextRecommendedUri,
isSearching: selectIsSearching(state),
isAuthenticated: selectUserVerifiedEmail(state),
};
};
export default connect(select, { doFetchRecommendedContent })(RecommendedContent);