From 47d2d3cbf289ebb2e893e07b5265aad8fcd64cb1 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Tue, 21 Nov 2023 16:58:13 -0600 Subject: [PWI] Shell (#1967) * Sidebars * Bottom bar * Drawer * Translate * Spacing fix * Fix responsive regression * Fix nit --- src/view/shell/Drawer.tsx | 175 +++++++++++++++++++++++++--------------------- 1 file changed, 94 insertions(+), 81 deletions(-) (limited to 'src/view/shell/Drawer.tsx') diff --git a/src/view/shell/Drawer.tsx b/src/view/shell/Drawer.tsx index 3d84c61bb..9df9b70b3 100644 --- a/src/view/shell/Drawer.tsx +++ b/src/view/shell/Drawer.tsx @@ -52,6 +52,7 @@ import {useUnreadNotifications} from '#/state/queries/notifications/unread' import {emitSoftReset} from '#/state/events' import {useInviteCodesQuery} from '#/state/queries/invites' import {RQKEY as NOTIFS_RQKEY} from '#/state/queries/notifications/feed' +import {NavSignupCard} from '#/view/shell/NavSignupCard' export function DrawerProfileCard({ account, @@ -112,7 +113,7 @@ export function DrawerContent() { const {track} = useAnalytics() const {isAtHome, isAtSearch, isAtFeeds, isAtNotifications, isAtMyProfile} = useNavigationTabState() - const {currentAccount} = useSession() + const {hasSession, currentAccount} = useSession() const numUnreadNotifications = useUnreadNotifications() // events @@ -218,18 +219,20 @@ export function DrawerContent() { ]}> - - {currentAccount && ( + {hasSession && currentAccount ? ( + - )} - + + ) : ( + + )} - + {hasSession && } - + {hasSession && } - } - size="24" - strokeWidth={1.7} - /> - ) : ( - } - size="24" - strokeWidth={1.7} - /> - ) - } - label={_(msg`Notifications`)} - accessibilityLabel={_(msg`Notifications`)} - accessibilityHint={ - numUnreadNotifications === '' - ? '' - : `${numUnreadNotifications} unread` - } - count={numUnreadNotifications} - bold={isAtNotifications} - onPress={onPressNotifications} - /> + + {hasSession && ( + } + size="24" + strokeWidth={1.7} + /> + ) : ( + } + size="24" + strokeWidth={1.7} + /> + ) + } + label={_(msg`Notifications`)} + accessibilityLabel={_(msg`Notifications`)} + accessibilityHint={ + numUnreadNotifications === '' + ? '' + : `${numUnreadNotifications} unread` + } + count={numUnreadNotifications} + bold={isAtNotifications} + onPress={onPressNotifications} + /> + )} + - } - label={_(msg`Lists`)} - accessibilityLabel={_(msg`Lists`)} - accessibilityHint="" - onPress={onPressLists} - /> - } - label={_(msg`Moderation`)} - accessibilityLabel={_(msg`Moderation`)} - accessibilityHint="" - onPress={onPressModeration} - /> - } - size="26" - strokeWidth={1.5} - /> - ) : ( - } - size="26" - strokeWidth={1.5} - /> - ) - } - label={_(msg`Profile`)} - accessibilityLabel={_(msg`Profile`)} - accessibilityHint="" - onPress={onPressProfile} - /> - } - size="26" - strokeWidth={1.75} + + {hasSession && ( + <> + } + label={_(msg`Lists`)} + accessibilityLabel={_(msg`Lists`)} + accessibilityHint="" + onPress={onPressLists} /> - } - label={_(msg`Settings`)} - accessibilityLabel={_(msg`Settings`)} - accessibilityHint="" - onPress={onPressSettings} - /> + } + label={_(msg`Moderation`)} + accessibilityLabel={_(msg`Moderation`)} + accessibilityHint="" + onPress={onPressModeration} + /> + } + size="26" + strokeWidth={1.5} + /> + ) : ( + } + size="26" + strokeWidth={1.5} + /> + ) + } + label={_(msg`Profile`)} + accessibilityLabel={_(msg`Profile`)} + accessibilityHint="" + onPress={onPressProfile} + /> + } + size="26" + strokeWidth={1.75} + /> + } + label={_(msg`Settings`)} + accessibilityLabel={_(msg`Settings`)} + accessibilityHint="" + onPress={onPressSettings} + /> + + )} +