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
id={'main-content'}
className={classnames(MAIN_CLASS, className, {
'main--full-width hide-ribbon': fullWidthPage,
'main--full-width': fullWidthPage,
'main--auth-page': authPage,
'main--file-page': filePage,
'main--video-page': filePage && !videoTheaterMode && !livestream && !isMarkdown,

View file

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

View file

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

View file

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

View file

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