Remove blocked and filtered reducers/selectors/actions. #7682
4 changed files with 3 additions and 34 deletions
|
@ -41,8 +41,6 @@ const select = (state, props) => {
|
||||||
isResolvingUri: collectionUri && selectIsUriResolving(state, collectionUri),
|
isResolvingUri: collectionUri && selectIsUriResolving(state, collectionUri),
|
||||||
thumbnail: getThumbnailFromClaim(claim),
|
thumbnail: getThumbnailFromClaim(claim),
|
||||||
title: collectionUri && selectTitleForUri(state, collectionUri),
|
title: collectionUri && selectTitleForUri(state, collectionUri),
|
||||||
blackListedOutpoints: [],
|
|
||||||
filteredOutpoints: [],
|
|
||||||
blockedChannelUris: selectMutedChannels(state),
|
blockedChannelUris: selectMutedChannels(state),
|
||||||
showMature: selectShowMatureContent(state),
|
showMature: selectShowMatureContent(state),
|
||||||
isMature: makeSelectClaimIsNsfw(collectionUri)(state),
|
isMature: makeSelectClaimIsNsfw(collectionUri)(state),
|
||||||
|
|
|
@ -25,14 +25,6 @@ type Props = {
|
||||||
thumbnail?: string,
|
thumbnail?: string,
|
||||||
title?: string,
|
title?: string,
|
||||||
placeholder: boolean,
|
placeholder: boolean,
|
||||||
blackListedOutpoints: Array<{
|
|
||||||
txid: string,
|
|
||||||
nout: number,
|
|
||||||
}>,
|
|
||||||
filteredOutpoints: Array<{
|
|
||||||
txid: string,
|
|
||||||
nout: number,
|
|
||||||
}>,
|
|
||||||
blockedChannelUris: Array<string>,
|
blockedChannelUris: Array<string>,
|
||||||
isMature?: boolean,
|
isMature?: boolean,
|
||||||
showMature: boolean,
|
showMature: boolean,
|
||||||
|
|
|
@ -28,7 +28,6 @@ const select = (state, props) => {
|
||||||
page: selectCurrentChannelPage(state),
|
page: selectCurrentChannelPage(state),
|
||||||
claim,
|
claim,
|
||||||
isSubscribed: selectIsSubscribedForUri(state, props.uri),
|
isSubscribed: selectIsSubscribedForUri(state, props.uri),
|
||||||
blackListedOutpoints: [],
|
|
||||||
subCount: selectSubCountForUri(state, props.uri),
|
subCount: selectSubCountForUri(state, props.uri),
|
||||||
pending: makeSelectClaimIsPending(props.uri)(state),
|
pending: makeSelectClaimIsPending(props.uri)(state),
|
||||||
youtubeChannels: selectYoutubeChannels(state),
|
youtubeChannels: selectYoutubeChannels(state),
|
||||||
|
|
|
@ -50,10 +50,6 @@ type Props = {
|
||||||
channelIsMine: boolean,
|
channelIsMine: boolean,
|
||||||
isSubscribed: boolean,
|
isSubscribed: boolean,
|
||||||
channelIsBlocked: boolean,
|
channelIsBlocked: boolean,
|
||||||
blackListedOutpoints: Array<{
|
|
||||||
txid: string,
|
|
||||||
nout: number,
|
|
||||||
}>,
|
|
||||||
fetchSubCount: (string) => void,
|
fetchSubCount: (string) => void,
|
||||||
subCount: number,
|
subCount: number,
|
||||||
pending: boolean,
|
pending: boolean,
|
||||||
|
@ -72,7 +68,6 @@ function ChannelPage(props: Props) {
|
||||||
// page, ?page= may come back some day?
|
// page, ?page= may come back some day?
|
||||||
channelIsMine,
|
channelIsMine,
|
||||||
isSubscribed,
|
isSubscribed,
|
||||||
blackListedOutpoints,
|
|
||||||
fetchSubCount,
|
fetchSubCount,
|
||||||
subCount,
|
subCount,
|
||||||
pending,
|
pending,
|
||||||
|
@ -135,14 +130,6 @@ function ChannelPage(props: Props) {
|
||||||
collectionEmpty = <section className="main--empty">{__('No Lists Found')}</section>;
|
collectionEmpty = <section className="main--empty">{__('No Lists Found')}</section>;
|
||||||
}
|
}
|
||||||
|
|
||||||
let channelIsBlackListed = false;
|
|
||||||
|
|
||||||
if (claim && blackListedOutpoints) {
|
|
||||||
channelIsBlackListed = blackListedOutpoints.some(
|
|
||||||
(outpoint) => outpoint.txid === claim.txid && outpoint.nout === claim.nout
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// If a user changes tabs, update the url so it stays on the same page if they refresh.
|
// If a user changes tabs, update the url so it stays on the same page if they refresh.
|
||||||
// We don't want to use links here because we can't animate the tab change and using links
|
// We don't want to use links here because we can't animate the tab change and using links
|
||||||
// would alter the Tab label's role attribute, which should stay role="tab" to work with keyboards/screen readers.
|
// would alter the Tab label's role attribute, which should stay role="tab" to work with keyboards/screen readers.
|
||||||
|
@ -219,9 +206,9 @@ function ChannelPage(props: Props) {
|
||||||
navigate={`/$/${PAGES.CHANNELS}`}
|
navigate={`/$/${PAGES.CHANNELS}`}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{!channelIsBlackListed && <ShareButton uri={uri} />}
|
<ShareButton uri={uri} />
|
||||||
{!(isBlocked || isMuted) && <ClaimSupportButton uri={uri} />}
|
{!(isBlocked || isMuted) && <ClaimSupportButton uri={uri} />}
|
||||||
{!(isBlocked || isMuted) && (!channelIsBlackListed || isSubscribed) && <SubscribeButton uri={permanentUrl} />}
|
{!(isBlocked || isMuted) && isSubscribed && <SubscribeButton uri={permanentUrl} />}
|
||||||
{/* TODO: add channel collections <ClaimCollectionAddButton uri={uri} fileAction /> */}
|
{/* TODO: add channel collections <ClaimCollectionAddButton uri={uri} fileAction /> */}
|
||||||
<ClaimMenuList uri={claim.permanent_url} inline isChannelPage />
|
<ClaimMenuList uri={claim.permanent_url} inline isChannelPage />
|
||||||
</div>
|
</div>
|
||||||
|
@ -293,7 +280,6 @@ function ChannelPage(props: Props) {
|
||||||
{currentView === PAGE.CONTENT && (
|
{currentView === PAGE.CONTENT && (
|
||||||
<ChannelContent
|
<ChannelContent
|
||||||
uri={uri}
|
uri={uri}
|
||||||
channelIsBlackListed={channelIsBlackListed}
|
|
||||||
viewHiddenChannels
|
viewHiddenChannels
|
||||||
claimType={['stream', 'repost']}
|
claimType={['stream', 'repost']}
|
||||||
empty={<section className="main--empty">{__('No Content Found')}</section>}
|
empty={<section className="main--empty">{__('No Content Found')}</section>}
|
||||||
|
@ -302,13 +288,7 @@ function ChannelPage(props: Props) {
|
||||||
</TabPanel>
|
</TabPanel>
|
||||||
<TabPanel>
|
<TabPanel>
|
||||||
{currentView === PAGE.LISTS && (
|
{currentView === PAGE.LISTS && (
|
||||||
<ChannelContent
|
<ChannelContent claimType={'collection'} uri={uri} viewHiddenChannels empty={collectionEmpty} />
|
||||||
claimType={'collection'}
|
|
||||||
uri={uri}
|
|
||||||
channelIsBlackListed={channelIsBlackListed}
|
|
||||||
viewHiddenChannels
|
|
||||||
empty={collectionEmpty}
|
|
||||||
/>
|
|
||||||
)}
|
)}
|
||||||
</TabPanel>
|
</TabPanel>
|
||||||
<TabPanel>
|
<TabPanel>
|
||||||
|
|
Loading…
Reference in a new issue