From c7e04a682635ed26f9b8736cc37d2c7bf07e2835 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Fri, 25 Nov 2022 14:38:09 -0600 Subject: [PATCH] SidebarNavigation: move local and fediverse tabs to top-level Fixes https://gitlab.com/soapbox-pub/soapbox/-/issues/1091 --- .../components/sidebar-navigation-link.tsx | 2 +- app/soapbox/components/sidebar-navigation.tsx | 40 +++++++++---------- 2 files changed, 19 insertions(+), 23 deletions(-) diff --git a/app/soapbox/components/sidebar-navigation-link.tsx b/app/soapbox/components/sidebar-navigation-link.tsx index 5c9100f85..25d3a75ee 100644 --- a/app/soapbox/components/sidebar-navigation-link.tsx +++ b/app/soapbox/components/sidebar-navigation-link.tsx @@ -10,7 +10,7 @@ interface ISidebarNavigationLink { /** URL to an SVG icon. */ icon: string, /** Link label. */ - text: React.ReactElement, + text: React.ReactNode, /** Route to an internal page. */ to?: string, /** Callback when the link is clicked. */ diff --git a/app/soapbox/components/sidebar-navigation.tsx b/app/soapbox/components/sidebar-navigation.tsx index b4e8941e7..a21475c3b 100644 --- a/app/soapbox/components/sidebar-navigation.tsx +++ b/app/soapbox/components/sidebar-navigation.tsx @@ -16,8 +16,6 @@ const messages = defineMessages({ bookmarks: { id: 'column.bookmarks', defaultMessage: 'Bookmarks' }, lists: { id: 'column.lists', defaultMessage: 'Lists' }, developers: { id: 'navigation.developers', defaultMessage: 'Developers' }, - all: { id: 'tabs_bar.all', defaultMessage: 'All' }, - fediverse: { id: 'tabs_bar.fediverse', defaultMessage: 'Fediverse' }, }); /** Desktop sidebar with links to different views in the app. */ @@ -70,26 +68,6 @@ const SidebarNavigation = () => { text: intl.formatMessage(messages.developers), }); } - - if (features.publicTimeline) { - menu.push(null); - } - } - - if (features.publicTimeline) { - menu.push({ - to: '/timeline/local', - icon: features.federating ? require('@tabler/icons/users.svg') : require('@tabler/icons/world.svg'), - text: features.federating ? instance.title : intl.formatMessage(messages.all), - }); - } - - if (features.publicTimeline && features.federating) { - menu.push({ - to: '/timeline/fediverse', - icon: require('assets/icons/fediverse.svg'), - text: intl.formatMessage(messages.fediverse), - }); } return menu; @@ -172,6 +150,24 @@ const SidebarNavigation = () => { )} + {features.publicTimeline && ( + <> + } + /> + + {features.federating && ( + } + /> + )} + + )} + {menu.length > 0 && (