From 38a52c501c99c774d5b62aba1b491d7e36c42a7f Mon Sep 17 00:00:00 2001 From: Gabe Kangas Date: Mon, 27 Feb 2023 17:39:45 -0800 Subject: [PATCH] Do not show custom page content sections if it is empty. Closes #2752 --- web/components/ui/Content/DesktopContent.tsx | 9 ++++++--- web/components/ui/Content/MobileContent.tsx | 8 +++++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/web/components/ui/Content/DesktopContent.tsx b/web/components/ui/Content/DesktopContent.tsx index cb3c6a9ca..748851480 100644 --- a/web/components/ui/Content/DesktopContent.tsx +++ b/web/components/ui/Content/DesktopContent.tsx @@ -52,8 +52,7 @@ export const DesktopContent: FC = ({ setShowFollowModal(true)} /> ); - - const items = [{ label: 'About', key: '2', children: aboutTabContent }]; + const items = [!!extraPageContent && { label: 'About', key: '2', children: aboutTabContent }]; if (supportFediverseFeatures) { items.push({ label: 'Followers', key: '3', children: followersTabContent }); } @@ -71,7 +70,11 @@ export const DesktopContent: FC = ({
- {items.length > 1 ? : aboutTabContent} + {items.length > 1 ? ( + + ) : ( + !!extraPageContent && aboutTabContent + )}
); diff --git a/web/components/ui/Content/MobileContent.tsx b/web/components/ui/Content/MobileContent.tsx index e5a0debbd..8405b10ca 100644 --- a/web/components/ui/Content/MobileContent.tsx +++ b/web/components/ui/Content/MobileContent.tsx @@ -86,9 +86,11 @@ export const MobileContent: FC = ({ const aboutTabContent = ( <> -
- -
+ {!!extraPageContent && ( +
+ +
+ )} ); const followersTabContent = (