Skip to content

Commit ef33b83

Browse files
committed
feat: migrate to primer design tokens
Signed-off-by: Adam Setch <[email protected]>
1 parent a7fc484 commit ef33b83

File tree

6 files changed

+656
-650
lines changed

6 files changed

+656
-650
lines changed

src/renderer/components/Sidebar.tsx

Lines changed: 70 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -69,80 +69,82 @@ export const Sidebar: FC = () => {
6969
}, [notifications]);
7070

7171
return (
72-
<div className="fixed left-12 -ml-12 flex h-full w-12 flex-col overflow-y-auto bg-gitify-sidebar">
73-
<div className="flex flex-1 flex-col">
74-
<Stack
75-
direction="vertical"
76-
align="center"
77-
gap="condensed"
78-
padding="normal"
79-
>
80-
<IconButton
81-
icon={LogoIcon}
82-
aria-label={APPLICATION.NAME}
83-
description="Home"
84-
unsafeDisableTooltip={false}
85-
size="small"
86-
variant="invisible"
87-
tooltipDirection="e"
88-
onClick={() => navigate('/', { replace: true })}
89-
data-testid="sidebar-home"
90-
/>
91-
92-
<IconButton
93-
icon={BellIcon}
94-
aria-label="Notifications"
95-
description={`${notificationsCount} unread notifications`}
96-
unsafeDisableTooltip={false}
97-
size="small"
98-
variant={notificationsCount > 0 ? 'primary' : 'invisible'}
99-
tooltipDirection="e"
100-
onClick={() => openGitHubNotifications(primaryAccountHostname)}
101-
data-testid="sidebar-notifications"
102-
sx={{ color: 'white' }}
103-
/>
104-
105-
{/* TODO - explore https://primer.style/components/selectpanel/react/alpha/ for a better UI for filters */}
106-
{isLoggedIn && (
107-
<IconButton
108-
icon={FilterIcon}
109-
aria-label="Filters"
110-
description="Filter notifications"
111-
unsafeDisableTooltip={false}
112-
size="small"
113-
variant={hasFiltersSet(settings) ? 'primary' : 'invisible'}
114-
tooltipDirection="e"
115-
onClick={() => toggleFilters()}
116-
data-testid="sidebar-filter-notifications"
117-
sx={{ color: 'white' }}
118-
/>
119-
)}
120-
72+
<Stack
73+
direction="vertical"
74+
justify="space-between"
75+
className="fixed left-12 -ml-12 w-12 h-full bg-gitify-sidebar"
76+
>
77+
<Stack
78+
direction="vertical"
79+
align="center"
80+
gap="condensed"
81+
padding="normal"
82+
>
83+
<IconButton
84+
icon={LogoIcon}
85+
aria-label={APPLICATION.NAME}
86+
description="Home"
87+
unsafeDisableTooltip={false}
88+
size="small"
89+
variant="invisible"
90+
tooltipDirection="e"
91+
onClick={() => navigate('/', { replace: true })}
92+
data-testid="sidebar-home"
93+
/>
94+
95+
<IconButton
96+
icon={BellIcon}
97+
aria-label="Notifications"
98+
description={`${notificationsCount} unread notifications`}
99+
unsafeDisableTooltip={false}
100+
size="small"
101+
variant={notificationsCount > 0 ? 'primary' : 'invisible'}
102+
tooltipDirection="e"
103+
onClick={() => openGitHubNotifications(primaryAccountHostname)}
104+
data-testid="sidebar-notifications"
105+
sx={{ color: 'white' }}
106+
/>
107+
108+
{/* TODO - explore https://primer.style/components/selectpanel/react/alpha/ for a better UI for filters */}
109+
{isLoggedIn && (
121110
<IconButton
122-
icon={IssueOpenedIcon}
123-
aria-label="My issues"
111+
icon={FilterIcon}
112+
aria-label="Filters"
113+
description="Filter notifications"
124114
unsafeDisableTooltip={false}
125115
size="small"
126-
variant="invisible"
116+
variant={hasFiltersSet(settings) ? 'primary' : 'invisible'}
127117
tooltipDirection="e"
128-
onClick={() => openGitHubIssues(primaryAccountHostname)}
129-
data-testid="sidebar-my-issues"
118+
onClick={() => toggleFilters()}
119+
data-testid="sidebar-filter-notifications"
130120
sx={{ color: 'white' }}
131121
/>
122+
)}
132123

133-
<IconButton
134-
icon={GitPullRequestIcon}
135-
aria-label="My pull requests"
136-
unsafeDisableTooltip={false}
137-
size="small"
138-
variant="invisible"
139-
tooltipDirection="e"
140-
onClick={() => openGitHubPulls(primaryAccountHostname)}
141-
data-testid="sidebar-my-pull-requests"
142-
sx={{ color: 'white' }}
143-
/>
144-
</Stack>
145-
</div>
124+
<IconButton
125+
icon={IssueOpenedIcon}
126+
aria-label="My issues"
127+
unsafeDisableTooltip={false}
128+
size="small"
129+
variant="invisible"
130+
tooltipDirection="e"
131+
onClick={() => openGitHubIssues(primaryAccountHostname)}
132+
data-testid="sidebar-my-issues"
133+
sx={{ color: 'white' }}
134+
/>
135+
136+
<IconButton
137+
icon={GitPullRequestIcon}
138+
aria-label="My pull requests"
139+
unsafeDisableTooltip={false}
140+
size="small"
141+
variant="invisible"
142+
tooltipDirection="e"
143+
onClick={() => openGitHubPulls(primaryAccountHostname)}
144+
data-testid="sidebar-my-pull-requests"
145+
sx={{ color: 'white' }}
146+
/>
147+
</Stack>
146148

147149
<Stack
148150
direction="vertical"
@@ -195,6 +197,6 @@ export const Sidebar: FC = () => {
195197
/>
196198
)}
197199
</Stack>
198-
</div>
200+
</Stack>
199201
);
200202
};

0 commit comments

Comments
 (0)