Repost: hide ribbon in Category Pages and Home Section

Allow in Following and Wild West

`index === 0` is not always Following, so compare link instead.
This commit is contained in:
infinite-persistence 2022-03-22 15:06:16 +08:00 committed by Thomas Zarebczan
parent 429653a7dc
commit 71e9837002
5 changed files with 18 additions and 7 deletions

View file

@ -130,7 +130,7 @@ function Page(props: Props) {
<main <main
id={'main-content'} id={'main-content'}
className={classnames(MAIN_CLASS, className, { className={classnames(MAIN_CLASS, className, {
'main--full-width hide-ribbon': fullWidthPage, 'main--full-width': fullWidthPage,
'main--auth-page': authPage, 'main--auth-page': authPage,
'main--file-page': filePage, 'main--file-page': filePage,
'main--video-page': filePage && !videoTheaterMode && !livestream && !isMarkdown, 'main--video-page': filePage && !videoTheaterMode && !livestream && !isMarkdown,

View file

@ -197,7 +197,9 @@ function AppRouter(props: Props) {
<Route <Route
key={dynamicRouteProps.route} key={dynamicRouteProps.route}
path={dynamicRouteProps.route} path={dynamicRouteProps.route}
component={(routerProps) => <DiscoverPage {...routerProps} dynamicRouteProps={dynamicRouteProps} />} component={(routerProps) => (
<DiscoverPage {...routerProps} dynamicRouteProps={dynamicRouteProps} hideRepostRibbon />
)}
/> />
)); ));
}, [homepageData, isLargeScreen]); }, [homepageData, isLargeScreen]);

View file

@ -1,9 +1,10 @@
// @flow // @flow
import React, { useRef } from 'react';
import classnames from 'classnames';
import { DOMAIN, SIMPLE_SITE } from 'config'; import { DOMAIN, SIMPLE_SITE } from 'config';
import * as ICONS from 'constants/icons'; import * as ICONS from 'constants/icons';
import * as PAGES from 'constants/pages'; import * as PAGES from 'constants/pages';
import * as CS from 'constants/claim_search'; import * as CS from 'constants/claim_search';
import React, { useRef } from 'react';
import Page from 'component/page'; import Page from 'component/page';
import ClaimListDiscover from 'component/claimListDiscover'; import ClaimListDiscover from 'component/claimListDiscover';
import Button from 'component/button'; import Button from 'component/button';
@ -24,6 +25,7 @@ type Props = {
followedTags: Array<Tag>, followedTags: Array<Tag>,
repostedUri: string, repostedUri: string,
repostedClaim: ?GenericClaim, repostedClaim: ?GenericClaim,
hideRepostRibbon?: boolean,
languageSetting: string, languageSetting: string,
searchInLanguage: boolean, searchInLanguage: boolean,
doToggleTagFollowDesktop: (string) => void, doToggleTagFollowDesktop: (string) => void,
@ -39,6 +41,7 @@ function DiscoverPage(props: Props) {
followedTags, followedTags,
repostedClaim, repostedClaim,
repostedUri, repostedUri,
hideRepostRibbon,
languageSetting, languageSetting,
searchInLanguage, searchInLanguage,
doToggleTagFollowDesktop, doToggleTagFollowDesktop,
@ -175,7 +178,11 @@ function DiscoverPage(props: Props) {
} }
return ( return (
<Page noFooter fullWidthPage={tileLayout} className="main__discover"> <Page
noFooter
fullWidthPage={tileLayout}
className={classnames('main__discover', { 'hide-ribbon': hideRepostRibbon })}
>
<ClaimListDiscover <ClaimListDiscover
pins={getPins(dynamicRouteProps)} pins={getPins(dynamicRouteProps)}
hideFilters={SIMPLE_SITE ? !(dynamicRouteProps || tags) : undefined} hideFilters={SIMPLE_SITE ? !(dynamicRouteProps || tags) : undefined}

View file

@ -116,11 +116,13 @@ function HomePage(props: Props) {
/> />
); );
const isFollowingSection = link === `/$/${PAGES.CHANNELS_FOLLOWING}`;
return ( return (
<div <div
key={title} key={title}
className={classnames('claim-grid__wrapper', { className={classnames('claim-grid__wrapper', {
'show-ribbon': index === 0, 'hide-ribbon': !isFollowingSection,
})} })}
> >
{title && typeof title === 'string' && ( {title && typeof title === 'string' && (
@ -141,7 +143,7 @@ function HomePage(props: Props) {
label={__('View More')} label={__('View More')}
/> />
)} )}
{title && (title === 'Recent From Following' || title === 'Following') && <RecommendedPersonal />} {isFollowingSection && <RecommendedPersonal />}
</div> </div>
); );
} }

View file

@ -1202,7 +1202,7 @@ img {
} }
.hide-ribbon { .hide-ribbon {
.claim-tile__repost-author { .claim-tile__repost-author {
// display: none; display: none;
} }
} }
.show-ribbon { .show-ribbon {