From f7f0db65d36506d1e32c3d349e4505136180afb0 Mon Sep 17 00:00:00 2001 From: renahlee Date: Tue, 16 May 2023 22:31:59 -0700 Subject: [PATCH 1/2] Update hint for notifications --- src/view/shell/Drawer.tsx | 6 +++++- src/view/shell/bottom-bar/BottomBar.tsx | 9 +++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/view/shell/Drawer.tsx b/src/view/shell/Drawer.tsx index d595bc52..89e30002 100644 --- a/src/view/shell/Drawer.tsx +++ b/src/view/shell/Drawer.tsx @@ -222,7 +222,11 @@ export const DrawerContent = observer(() => { } label="Notifications" accessibilityLabel="Notifications" - accessibilityHint={`${store.me.notifications.unreadCountLabel} unread`} + accessibilityHint={ + notifications.unreadCountLabel === '' + ? 'No new notifications' + : `${notifications.unreadCountLabel} unread` + } count={notifications.unreadCountLabel} bold={isAtNotifications} onPress={onPressNotifications} diff --git a/src/view/shell/bottom-bar/BottomBar.tsx b/src/view/shell/bottom-bar/BottomBar.tsx index c11a0128..b057964c 100644 --- a/src/view/shell/bottom-bar/BottomBar.tsx +++ b/src/view/shell/bottom-bar/BottomBar.tsx @@ -38,6 +38,7 @@ export const BottomBar = observer(({navigation}: BottomTabBarProps) => { useNavigationTabState() const {footerMinimalShellTransform} = useMinimalShellMode() + const {notifications} = store.me const onPressTab = React.useCallback( (tab: string) => { @@ -138,11 +139,15 @@ export const BottomBar = observer(({navigation}: BottomTabBarProps) => { ) } onPress={onPressNotifications} - notificationCount={store.me.notifications.unreadCountLabel} + notificationCount={notifications.unreadCountLabel} accessible={true} accessibilityRole="tab" accessibilityLabel="Notifications" - accessibilityHint={`${store.me.notifications.unreadCountLabel} unread`} + accessibilityHint={ + notifications.unreadCountLabel === '' + ? 'No new notifications' + : `${notifications.unreadCountLabel} unread` + } /> Date: Wed, 17 May 2023 09:13:06 -0700 Subject: [PATCH 2/2] Update to empty hint if no notifications --- src/view/shell/Drawer.tsx | 2 +- src/view/shell/bottom-bar/BottomBar.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/view/shell/Drawer.tsx b/src/view/shell/Drawer.tsx index 89e30002..2ecdbaab 100644 --- a/src/view/shell/Drawer.tsx +++ b/src/view/shell/Drawer.tsx @@ -224,7 +224,7 @@ export const DrawerContent = observer(() => { accessibilityLabel="Notifications" accessibilityHint={ notifications.unreadCountLabel === '' - ? 'No new notifications' + ? '' : `${notifications.unreadCountLabel} unread` } count={notifications.unreadCountLabel} diff --git a/src/view/shell/bottom-bar/BottomBar.tsx b/src/view/shell/bottom-bar/BottomBar.tsx index b057964c..ef9499f9 100644 --- a/src/view/shell/bottom-bar/BottomBar.tsx +++ b/src/view/shell/bottom-bar/BottomBar.tsx @@ -145,7 +145,7 @@ export const BottomBar = observer(({navigation}: BottomTabBarProps) => { accessibilityLabel="Notifications" accessibilityHint={ notifications.unreadCountLabel === '' - ? 'No new notifications' + ? '' : `${notifications.unreadCountLabel} unread` } />