From 2bd468358b067247716c786f6c30f8bb91264de4 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Thu, 12 May 2022 11:38:01 -0500 Subject: [PATCH 1/2] Rearrange SidebarNavigation --- app/soapbox/components/sidebar-navigation.tsx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/soapbox/components/sidebar-navigation.tsx b/app/soapbox/components/sidebar-navigation.tsx index a6f2fef6b..d436cb4cb 100644 --- a/app/soapbox/components/sidebar-navigation.tsx +++ b/app/soapbox/components/sidebar-navigation.tsx @@ -149,12 +149,6 @@ const SidebarNavigation = () => { {account && ( <> - } - /> - { text={} /> + {renderMessagesLink()} + + } + /> + { )} - {account && renderMessagesLink()} - {menu.length > 0 && ( Date: Thu, 12 May 2022 11:55:13 -0500 Subject: [PATCH 2/2] SidebarNavigationLink: add jsdoc comments --- app/soapbox/components/sidebar-navigation-link.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/soapbox/components/sidebar-navigation-link.tsx b/app/soapbox/components/sidebar-navigation-link.tsx index 9dbedd46a..9442a4cc4 100644 --- a/app/soapbox/components/sidebar-navigation-link.tsx +++ b/app/soapbox/components/sidebar-navigation-link.tsx @@ -5,13 +5,19 @@ import { NavLink } from 'react-router-dom'; import { Icon, Text, Counter } from './ui'; interface ISidebarNavigationLink { + /** Notification count, if any. */ count?: number, + /** URL to an SVG icon. */ icon: string, - text: string | React.ReactElement, + /** Link label. */ + text: React.ReactElement, + /** Route to an internal page. */ to?: string, + /** Callback when the link is clicked. */ onClick?: React.EventHandler, } +/** Desktop sidebar navigation link. */ const SidebarNavigationLink = React.forwardRef((props: ISidebarNavigationLink, ref: React.ForwardedRef): JSX.Element => { const { icon, text, to = '', count, onClick } = props; const isActive = location.pathname === to;