hide block button on channel discovery page

This commit is contained in:
Sean Yesmunt 2020-02-26 14:20:38 -05:00
parent 73c60f62ac
commit cc94cb6745
3 changed files with 27 additions and 18 deletions

View file

@ -32,6 +32,7 @@ type Props = {
showUnresolvedClaims?: boolean, showUnresolvedClaims?: boolean,
renderProperties: ?(Claim) => Node, renderProperties: ?(Claim) => Node,
includeSupportAction?: boolean, includeSupportAction?: boolean,
hideBlock: boolean,
}; };
export default function ClaimList(props: Props) { export default function ClaimList(props: Props) {
@ -53,6 +54,7 @@ export default function ClaimList(props: Props) {
showUnresolvedClaims, showUnresolvedClaims,
renderProperties, renderProperties,
includeSupportAction, includeSupportAction,
hideBlock,
} = props; } = props;
const [scrollBottomCbMap, setScrollBottomCbMap] = useState({}); const [scrollBottomCbMap, setScrollBottomCbMap] = useState({});
const [currentSort, setCurrentSort] = usePersistedState(persistedStorageKey, SORT_NEW); const [currentSort, setCurrentSort] = usePersistedState(persistedStorageKey, SORT_NEW);
@ -140,6 +142,7 @@ export default function ClaimList(props: Props) {
showUnresolvedClaim={showUnresolvedClaims} showUnresolvedClaim={showUnresolvedClaims}
properties={renderProperties || (type !== 'small' ? undefined : false)} properties={renderProperties || (type !== 'small' ? undefined : false)}
showUserBlocked={showHiddenByUser} showUserBlocked={showHiddenByUser}
hideBlock={hideBlock}
customShouldHide={(claim: StreamClaim) => { customShouldHide={(claim: StreamClaim) => {
// Hack to hide spee.ch thumbnail publishes // Hack to hide spee.ch thumbnail publishes
// If it meets these requirements, it was probably uploaded here: // If it meets these requirements, it was probably uploaded here:

View file

@ -55,6 +55,7 @@ type Props = {
renderProperties?: Claim => Node, renderProperties?: Claim => Node,
includeSupportAction?: boolean, includeSupportAction?: boolean,
noInfiniteScroll: boolean, noInfiniteScroll: boolean,
hideBlock: boolean,
}; };
function ClaimListDiscover(props: Props) { function ClaimListDiscover(props: Props) {
@ -82,6 +83,7 @@ function ClaimListDiscover(props: Props) {
renderProperties, renderProperties,
includeSupportAction, includeSupportAction,
noInfiniteScroll, noInfiniteScroll,
hideBlock,
} = props; } = props;
const didNavigateForward = history.action === 'PUSH'; const didNavigateForward = history.action === 'PUSH';
const [page, setPage] = useState(1); const [page, setPage] = useState(1);
@ -296,6 +298,7 @@ function ClaimListDiscover(props: Props) {
empty={noResults} empty={noResults}
renderProperties={renderProperties} renderProperties={renderProperties}
includeSupportAction={includeSupportAction} includeSupportAction={includeSupportAction}
hideBlock={hideBlock}
/> />
<div className="card"> <div className="card">

View file

@ -21,25 +21,28 @@ function UserChannelFollowIntro(props: Props) {
'LBRY works better if you find and follow at least 5 creators you like. You can also block channels you never want to see.' 'LBRY works better if you find and follow at least 5 creators you like. You can also block channels you never want to see.'
)} )}
</p> </p>
<ClaimListDiscover <div className="section__body">
defaultTypeSort={TYPE_TOP} <ClaimListDiscover
defaultTimeSort={TIME_ALL} defaultTypeSort={TYPE_TOP}
pageSize={99} defaultTimeSort={TIME_ALL}
claimType="channel" pageSize={99}
noInfiniteScroll claimType="channel"
/> noInfiniteScroll
{followingCount > 0 && ( hideBlock
<Nag
type="helpful"
message={
followingCount === 1
? __('Nice! You are currently following %followingCount% creator', { followingCount })
: __('Nice! You are currently following %followingCount% creators', { followingCount })
}
actionText={__('Continue')}
onClick={onContinue}
/> />
)} {followingCount > 0 && (
<Nag
type="helpful"
message={
followingCount === 1
? __('Nice! You are currently following %followingCount% creator', { followingCount })
: __('Nice! You are currently following %followingCount% creators', { followingCount })
}
actionText={__('Continue')}
onClick={onContinue}
/>
)}
</div>
</React.Fragment> </React.Fragment>
); );
} }