diff --git a/app/soapbox/components/sidebar-navigation.tsx b/app/soapbox/components/sidebar-navigation.tsx index 16b305b33..3ce3b9e28 100644 --- a/app/soapbox/components/sidebar-navigation.tsx +++ b/app/soapbox/components/sidebar-navigation.tsx @@ -106,6 +106,32 @@ const SidebarNavigation = () => { const menu = makeMenu(); + /** Conditionally render the supported messages link */ + const renderMessagesLink = (): React.ReactNode => { + if (features.chats) { + return ( + } + /> + ); + } + + if (features.directTimeline || features.conversations) { + return ( + } + /> + ); + } + + return null; + }; + return (
@@ -138,22 +164,7 @@ const SidebarNavigation = () => { )} - {account && ( - features.chats ? ( - } - /> - ) : ( - } - /> - ) - )} + {account && renderMessagesLink()} {menu.length > 0 && ( diff --git a/app/soapbox/components/thumb_navigation.tsx b/app/soapbox/components/thumb_navigation.tsx index 21de09300..c1ac80fae 100644 --- a/app/soapbox/components/thumb_navigation.tsx +++ b/app/soapbox/components/thumb_navigation.tsx @@ -12,6 +12,34 @@ const ThumbNavigation: React.FC = (): JSX.Element => { const dashboardCount = useAppSelector((state) => state.admin.openReports.count() + state.admin.awaitingApproval.count()); const features = getFeatures(useAppSelector((state) => state.instance)); + /** Conditionally render the supported messages link */ + const renderMessagesLink = (): React.ReactNode => { + if (features.chats) { + return ( + } + to='/chats' + exact + count={chatsCount} + /> + ); + } + + if (features.directTimeline || features.conversations) { + return ( + } + to='/messages' + paths={['/messages', '/conversations']} + /> + ); + } + + return null; + }; + return (
{ /> )} - {account && ( - features.chats ? ( - } - to='/chats' - exact - count={chatsCount} - /> - ) : ( - } - to='/messages' - paths={['/messages', '/conversations']} - /> - ) - )} + {account && renderMessagesLink()} {(account && account.staff) && ( - - - - {intl.formatMessage(messages.title)} - {intl.formatMessage(messages.body)} - - - + + + + } + /> ); - - // return ( - // - // - - // - - // } - // /> - // - // ); } } diff --git a/app/soapbox/features/ui/index.tsx b/app/soapbox/features/ui/index.tsx index e144c9b01..3b9255ec0 100644 --- a/app/soapbox/features/ui/index.tsx +++ b/app/soapbox/features/ui/index.tsx @@ -187,8 +187,12 @@ const SwitchingColumnsArea: React.FC = ({ children }) => { {features.federating && } {features.federating && } - - + {features.conversations && } + {features.directTimeline ? ( + + ) : ( + + )} {/* Gab groups */} {/*