@@ -16,24 +16,26 @@ import { IconButton, Stack } from '@primer/react';
1616import { APPLICATION } from '../../shared/constants' ;
1717
1818import { useAppContext } from '../hooks/useAppContext' ;
19- import { useShortcutActions } from '../hooks/useGlobalShortcuts' ;
20- import { useFiltersStore } from '../stores' ;
19+ import { useGlobalShortcuts } from '../hooks/useGlobalShortcuts' ;
20+ import { useAccountsStore , useFiltersStore , useSettingsStore } from '../stores' ;
2121
2222import { LogoIcon } from './icons/LogoIcon' ;
2323
2424export const Sidebar : FC = ( ) => {
25- const {
26- status,
27- isLoggedIn,
28- settings,
29- notificationCount,
30- hasUnreadNotifications,
31- } = useAppContext ( ) ;
25+ const { status, notificationCount, hasUnreadNotifications } = useAppContext ( ) ;
3226
33- const { shortcuts } = useShortcutActions ( ) ;
27+ const { shortcuts } = useGlobalShortcuts ( ) ;
28+
29+ const isLoggedIn = useAccountsStore ( ( s ) => s . isLoggedIn ( ) ) ;
3430
3531 const hasFilters = useFiltersStore ( ( s ) => s . hasActiveFilters ( ) ) ;
3632
33+ // Subscribe to settings from store
34+ const fetchReadNotifications = useSettingsStore (
35+ ( s ) => s . fetchReadNotifications ,
36+ ) ;
37+ const participating = useSettingsStore ( ( s ) => s . participating ) ;
38+
3739 const isLoading = status === 'loading' ;
3840
3941 return (
@@ -63,7 +65,7 @@ export const Sidebar: FC = () => {
6365 < IconButton
6466 aria-label = "Notifications"
6567 data-testid = "sidebar-notifications"
66- description = { `${ notificationCount } ${ settings . fetchReadNotifications ? 'notifications' : 'unread notifications' } ↗` }
68+ description = { `${ notificationCount } ${ fetchReadNotifications ? 'notifications' : 'unread notifications' } ↗` }
6769 icon = { BellIcon }
6870 keybindingHint = { shortcuts . myNotifications . key }
6971 onClick = { ( ) => shortcuts . myNotifications . action ( ) }
@@ -78,16 +80,16 @@ export const Sidebar: FC = () => {
7880 aria-label = "Toggle focused mode"
7981 data-testid = "sidebar-focused-mode"
8082 description = {
81- settings . participating
83+ participating
8284 ? 'Focused (participating only)'
8385 : 'Participating and watching'
8486 }
85- icon = { settings . participating ? CrosshairsIcon : EyeIcon }
87+ icon = { participating ? CrosshairsIcon : EyeIcon }
8688 keybindingHint = { shortcuts . focusedMode . key }
8789 onClick = { ( ) => shortcuts . focusedMode . action ( ) }
8890 size = "small"
8991 tooltipDirection = "e"
90- variant = { settings . participating ? 'primary' : 'invisible' }
92+ variant = { participating ? 'primary' : 'invisible' }
9193 />
9294
9395 < IconButton
0 commit comments