hide claimList filters on channel discovery and sign in pages

This commit is contained in:
Sean Yesmunt 2020-02-28 16:52:42 -05:00
parent 226c5b5495
commit ffd2c4f793
4 changed files with 19 additions and 10 deletions

View file

@ -41,13 +41,14 @@ type Props = {
headerLabel?: string | Node,
name?: string,
hideBlock?: boolean,
claimType?: string | Array<string>,
defaultClaimType?: string | Array<string>,
hideFilter?: boolean,
claimType?: Array<string>,
defaultClaimType?: Array<string>,
streamType?: string | Array<string>,
defaultStreamType?: string | Array<string>,
renderProperties?: Claim => Node,
includeSupportAction?: boolean,
noCustom?: boolean,
pageSize?: number,
};
function ClaimListDiscover(props: Props) {
@ -79,7 +80,7 @@ function ClaimListDiscover(props: Props) {
defaultFreshness = CS.FRESH_WEEK,
renderProperties,
includeSupportAction,
noCustom,
hideFilter,
} = props;
const didNavigateForward = history.action === 'PUSH';
const { search } = location;
@ -118,9 +119,7 @@ function ClaimListDiscover(props: Props) {
release_time?: string,
claim_type?: Array<string>,
name?: string,
claim_type?: Array<string>,
duration?: string,
claim_type?: string | Array<string>,
stream_types?: any,
} = {
page_size: pageSize || CS.PAGE_SIZE,
@ -196,9 +195,13 @@ function ClaimListDiscover(props: Props) {
if (claimTypeParam) {
if (claimTypeParam !== CS.CONTENT_ALL) {
if (Array.isArray(claimTypeParam)) {
options.claim_type = claimTypeParam;
} else {
options.claim_type = [claimTypeParam];
}
}
}
if (!showReposts) {
options.claim_type =
@ -329,7 +332,7 @@ function ClaimListDiscover(props: Props) {
))}
</div>
<div>
{!noCustom && (
{!hideFilter && (
<Button
button={'alt'}
aria-label={__('More')}

View file

@ -27,6 +27,7 @@ function UserChannelFollowIntro(props: Props) {
defaultTimeSort={CS.FRESH_ALL}
claimType="channel"
hideBlock
hideFilter
/>
{followingCount > 0 && (
<Nag

View file

@ -115,7 +115,12 @@ function ChannelsFollowingDiscover(props: Props) {
</div>
))}
<h1 className="claim-grid__title">{__('More Channels')}</h1>
<ClaimListDiscover defaultTypeSort={CS.ORDER_BY_TOP} defaultTimeSort={CS.FRESH_ALL} claimType="channel" />
<ClaimListDiscover
defaultTypeSort={CS.ORDER_BY_TOP}
defaultTimeSort={CS.FRESH_ALL}
claimType="channel"
hideFilter
/>
</Page>
);
}

View file

@ -48,7 +48,7 @@ function TagsPage(props: Props) {
return (
<Page>
<ClaimListDiscover
claimType={claimType}
claimType={[claimType]}
headerLabel={
tag ? (
<span>