block channels on homepage
This commit is contained in:
parent
dea9cc0661
commit
be84f73387
3 changed files with 17 additions and 2 deletions
|
@ -906,5 +906,7 @@
|
||||||
"This Year": "This Year",
|
"This Year": "This Year",
|
||||||
"Khmer": "Khmer",
|
"Khmer": "Khmer",
|
||||||
"Invites": "Invites",
|
"Invites": "Invites",
|
||||||
"This is an experiment, and may be removed in the future. Publish something with the #homepagecagematch tag to battle for the top spot on the home page!": "This is an experiment, and may be removed in the future. Publish something with the #homepagecagematch tag to battle for the top spot on the home page!"
|
"This is an experiment, and may be removed in the future. Publish something with the #homepagecagematch tag to battle for the top spot on the home page!": "This is an experiment, and may be removed in the future. Publish something with the #homepagecagematch tag to battle for the top spot on the home page!",
|
||||||
|
"%claimsInChannel% publishes": "%claimsInChannel% publishes",
|
||||||
|
"%claimsInChannel% publish": "%claimsInChannel% publish"
|
||||||
}
|
}
|
|
@ -7,6 +7,7 @@ import {
|
||||||
makeSelectTitleForUri,
|
makeSelectTitleForUri,
|
||||||
doFileGet,
|
doFileGet,
|
||||||
makeSelectChannelForClaimUri,
|
makeSelectChannelForClaimUri,
|
||||||
|
selectBlockedChannels,
|
||||||
} from 'lbry-redux';
|
} from 'lbry-redux';
|
||||||
import { selectBlackListedOutpoints, selectFilteredOutpoints } from 'lbryinc';
|
import { selectBlackListedOutpoints, selectFilteredOutpoints } from 'lbryinc';
|
||||||
import ClaimPreviewTile from './view';
|
import ClaimPreviewTile from './view';
|
||||||
|
@ -19,6 +20,7 @@ const select = (state, props) => ({
|
||||||
title: props.uri && makeSelectTitleForUri(props.uri)(state),
|
title: props.uri && makeSelectTitleForUri(props.uri)(state),
|
||||||
blackListedOutpoints: selectBlackListedOutpoints(state),
|
blackListedOutpoints: selectBlackListedOutpoints(state),
|
||||||
filteredOutpoints: selectFilteredOutpoints(state),
|
filteredOutpoints: selectFilteredOutpoints(state),
|
||||||
|
blockedChannelUris: selectBlockedChannels(state),
|
||||||
});
|
});
|
||||||
|
|
||||||
const perform = dispatch => ({
|
const perform = dispatch => ({
|
||||||
|
|
|
@ -49,6 +49,7 @@ function ClaimPreviewTile(props: Props) {
|
||||||
filteredOutpoints,
|
filteredOutpoints,
|
||||||
getFile,
|
getFile,
|
||||||
streamingUrl,
|
streamingUrl,
|
||||||
|
blockedChannelUris,
|
||||||
} = props;
|
} = props;
|
||||||
const shouldFetch = claim === undefined;
|
const shouldFetch = claim === undefined;
|
||||||
const thumbnailUrl = useGetThumbnail(uri, claim, streamingUrl, getFile, placeholder) || thumbnail;
|
const thumbnailUrl = useGetThumbnail(uri, claim, streamingUrl, getFile, placeholder) || thumbnail;
|
||||||
|
@ -107,6 +108,16 @@ function ClaimPreviewTile(props: Props) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// block stream claims
|
||||||
|
if (claim && !shouldHide && blockedChannelUris.length && signingChannel) {
|
||||||
|
shouldHide = blockedChannelUris.some(blockedUri => blockedUri === signingChannel.permanent_url);
|
||||||
|
}
|
||||||
|
// block channel claims if we can't control for them in claim search
|
||||||
|
// e.g. fetchRecommendedSubscriptions
|
||||||
|
if (claim && isChannel && !shouldHide && blockedChannelUris.length) {
|
||||||
|
shouldHide = blockedChannelUris.some(blockedUri => blockedUri === claim.permanent_url);
|
||||||
|
}
|
||||||
|
|
||||||
if (shouldHide) {
|
if (shouldHide) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -136,7 +147,7 @@ function ClaimPreviewTile(props: Props) {
|
||||||
</NavLink>
|
</NavLink>
|
||||||
<NavLink to={navigateUrl}>
|
<NavLink to={navigateUrl}>
|
||||||
<h2 className="claim-tile__title">
|
<h2 className="claim-tile__title">
|
||||||
<TruncatedText text={title} lines={2} />
|
<TruncatedText text={title || (claim && claim.name)} lines={2} />
|
||||||
</h2>
|
</h2>
|
||||||
</NavLink>
|
</NavLink>
|
||||||
<div className="claim-tile__info">
|
<div className="claim-tile__info">
|
||||||
|
|
Loading…
Reference in a new issue