Do not show custom page content sections if it is empty. Closes #2752

This commit is contained in:
Gabe Kangas 2023-02-27 17:39:45 -08:00
parent f2c8278780
commit 38a52c501c
No known key found for this signature in database
GPG key ID: 4345B2060657F330
2 changed files with 11 additions and 6 deletions

View file

@ -52,8 +52,7 @@ export const DesktopContent: FC<DesktopContentProps> = ({
<FollowerCollection name={name} onFollowButtonClick={() => setShowFollowModal(true)} /> <FollowerCollection name={name} onFollowButtonClick={() => setShowFollowModal(true)} />
</div> </div>
); );
const items = [!!extraPageContent && { label: 'About', key: '2', children: aboutTabContent }];
const items = [{ label: 'About', key: '2', children: aboutTabContent }];
if (supportFediverseFeatures) { if (supportFediverseFeatures) {
items.push({ label: 'Followers', key: '3', children: followersTabContent }); items.push({ label: 'Followers', key: '3', children: followersTabContent });
} }
@ -71,7 +70,11 @@ export const DesktopContent: FC<DesktopContentProps> = ({
</div> </div>
<div className={styles.lowerSection}> <div className={styles.lowerSection}>
{items.length > 1 ? <Tabs defaultActiveKey="0" items={items} /> : aboutTabContent} {items.length > 1 ? (
<Tabs defaultActiveKey="0" items={items} />
) : (
!!extraPageContent && aboutTabContent
)}
</div> </div>
</> </>
); );

View file

@ -86,9 +86,11 @@ export const MobileContent: FC<MobileContentProps> = ({
const aboutTabContent = ( const aboutTabContent = (
<> <>
<ContentHeader name={name} summary={summary} tags={tags} links={socialHandles} logo="/logo" /> <ContentHeader name={name} summary={summary} tags={tags} links={socialHandles} logo="/logo" />
<div className={styles.bottomPageContentContainer}> {!!extraPageContent && (
<CustomPageContent content={extraPageContent} /> <div className={styles.bottomPageContentContainer}>
</div> <CustomPageContent content={extraPageContent} />
</div>
)}
</> </>
); );
const followersTabContent = ( const followersTabContent = (