From 829f6a9e643b058fa2cc60a225447df7bc65bd36 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Thu, 16 May 2024 20:13:55 -0500 Subject: [PATCH] Conditionally load unreads (#4072) --- src/view/shell/desktop/LeftNav.tsx | 62 ++++++++++++++++++------------ 1 file changed, 37 insertions(+), 25 deletions(-) diff --git a/src/view/shell/desktop/LeftNav.tsx b/src/view/shell/desktop/LeftNav.tsx index c0034e7bec..3fc0774f36 100644 --- a/src/view/shell/desktop/LeftNav.tsx +++ b/src/view/shell/desktop/LeftNav.tsx @@ -66,6 +66,8 @@ import { } from '#/components/icons/UserCircle' import {router} from '../../../routes' +const NAV_ICON_WIDTH = 28 + function ProfileCard() { const {currentAccount} = useSession() const {isLoading, data: profile} = useProfileQuery({did: currentAccount!.did}) @@ -280,15 +282,29 @@ function ComposeBtn() { ) } +function ChatNavItem() { + const pal = usePalette('default') + const {_} = useLingui() + const numUnreadMessages = useUnreadMessageCount() + + return ( + } + iconFilled={} + label={_(msg`Chat`)} + /> + ) +} + export function DesktopLeftNav() { const {hasSession, currentAccount} = useSession() const pal = usePalette('default') const {_} = useLingui() const {isDesktop, isTablet} = useWebMediaQueries() const numUnreadNotifications = useUnreadNotifications() - const numUnreadMessages = useUnreadMessageCount() const gate = useGate() - const iconWidth = 28 if (!hasSession && !isDesktop) { return null @@ -316,66 +332,62 @@ export function DesktopLeftNav() { } - iconFilled={} + icon={} + iconFilled={} label={_(msg`Home`)} /> } + icon={} iconFilled={ - + } label={_(msg`Search`)} /> } - iconFilled={} + icon={} + iconFilled={} label={_(msg`Notifications`)} /> - {gate('dms') && ( - } - iconFilled={} - label={_(msg`Chat`)} - /> - )} + {gate('dms') && } } iconFilled={ } label={_(msg`Feeds`)} /> } - iconFilled={} + icon={} + iconFilled={} label={_(msg`Lists`)} /> } - iconFilled={} + icon={} + iconFilled={ + + } label={_(msg`Profile`)} /> } - iconFilled={} + icon={} + iconFilled={ + + } label={_(msg`Settings`)} />