()
| 22 | import { LogoIcon } from './icons/LogoIcon'; |
| 23 | |
| 24 | export const Sidebar: FC = () => { |
| 25 | const { |
| 26 | status, |
| 27 | isLoggedIn, |
| 28 | settings, |
| 29 | notificationCount, |
| 30 | hasUnreadNotifications, |
| 31 | } = useAppContext(); |
| 32 | |
| 33 | const { shortcuts } = useShortcutActions(); |
| 34 | |
| 35 | const hasFilters = useFiltersStore((s) => s.hasActiveFilters()); |
| 36 | |
| 37 | const isLoading = status === 'loading'; |
| 38 | |
| 39 | return ( |
| 40 | <Stack |
| 41 | className="fixed w-sidebar h-full bg-gitify-sidebar [&_svg]:text-white" |
| 42 | direction="vertical" |
| 43 | justify="space-between" |
| 44 | > |
| 45 | <Stack |
| 46 | align="center" |
| 47 | direction="vertical" |
| 48 | gap="condensed" |
| 49 | padding="normal" |
| 50 | > |
| 51 | <IconButton |
| 52 | aria-label={APPLICATION.NAME} |
| 53 | data-testid="sidebar-home" |
| 54 | description="Home" |
| 55 | icon={LogoIcon} |
| 56 | keybindingHint={shortcuts.home.key} |
| 57 | onClick={() => shortcuts.home.action()} |
| 58 | size="small" |
| 59 | tooltipDirection="e" |
| 60 | variant="invisible" |
| 61 | /> |
| 62 | |
| 63 | <IconButton |
| 64 | aria-label="Notifications" |
| 65 | data-testid="sidebar-notifications" |
| 66 | description={`${notificationCount} ${settings.fetchReadNotifications ? 'notifications' : 'unread notifications'} ↗`} |
| 67 | icon={BellIcon} |
| 68 | keybindingHint={shortcuts.myNotifications.key} |
| 69 | onClick={() => shortcuts.myNotifications.action()} |
| 70 | size="small" |
| 71 | tooltipDirection="e" |
| 72 | variant={hasUnreadNotifications ? 'primary' : 'invisible'} |
| 73 | /> |
| 74 | |
| 75 | {isLoggedIn && ( |
| 76 | <> |
| 77 | <IconButton |
| 78 | aria-label="Toggle focused mode" |
| 79 | data-testid="sidebar-focused-mode" |
| 80 | description={ |
| 81 | settings.participating |
nothing calls this directly
no test coverage detected