From e3f92eadace3048c4496c5521a5978b41da40561 Mon Sep 17 00:00:00 2001 From: Chewbacca Date: Wed, 14 Jun 2023 08:05:25 -0400 Subject: [PATCH] Add Groups to Thumb Navigation --- app/soapbox/components/thumb-navigation.tsx | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/app/soapbox/components/thumb-navigation.tsx b/app/soapbox/components/thumb-navigation.tsx index 6abaa084e..013ecece7 100644 --- a/app/soapbox/components/thumb-navigation.tsx +++ b/app/soapbox/components/thumb-navigation.tsx @@ -3,15 +3,17 @@ import { FormattedMessage } from 'react-intl'; import ThumbNavigationLink from 'soapbox/components/thumb-navigation-link'; import { useStatContext } from 'soapbox/contexts/stat-context'; -import { useAppSelector, useFeatures, useOwnAccount } from 'soapbox/hooks'; +import { useAppSelector, useFeatures, useGroupsPath, useOwnAccount } from 'soapbox/hooks'; const ThumbNavigation: React.FC = (): JSX.Element => { const account = useOwnAccount(); + const features = useFeatures(); + const groupsPath = useGroupsPath(); + const { unreadChatsCount } = useStatContext(); const notificationCount = useAppSelector((state) => state.notifications.unread); const dashboardCount = useAppSelector((state) => state.admin.openReports.count() + state.admin.awaitingApproval.count()); - const features = useFeatures(); /** Conditionally render the supported messages link */ const renderMessagesLink = (): React.ReactNode => { @@ -51,6 +53,15 @@ const ThumbNavigation: React.FC = (): JSX.Element => { exact /> + {features.groups && ( + } + to={groupsPath} + exact + /> + )} + }