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

View file

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

View file

@ -115,7 +115,12 @@ function ChannelsFollowingDiscover(props: Props) {
</div> </div>
))} ))}
<h1 className="claim-grid__title">{__('More Channels')}</h1> <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> </Page>
); );
} }

View file

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