Skip to content

Commit 699564b

Browse files
committed
refactor: replace some sx uses
Signed-off-by: Adam Setch <[email protected]>
1 parent 7d93a71 commit 699564b

File tree

5 files changed

+27
-28
lines changed

5 files changed

+27
-28
lines changed

src/renderer/components/Sidebar.tsx

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,13 @@ export const Sidebar: FC = () => {
6868
return getNotificationCount(notifications);
6969
}, [notifications]);
7070

71+
const sidebarButtonStyle = { color: 'white' };
72+
7173
return (
7274
<Stack
7375
direction="vertical"
7476
justify="space-between"
75-
className="fixed left-12 -ml-12 w-12 h-full bg-gitify-sidebar"
77+
className="fixed left-12 -ml-12 w-12 h-full bg-gitify-sidebar text-white"
7678
>
7779
<Stack
7880
direction="vertical"
@@ -102,10 +104,9 @@ export const Sidebar: FC = () => {
102104
tooltipDirection="e"
103105
onClick={() => openGitHubNotifications(primaryAccountHostname)}
104106
data-testid="sidebar-notifications"
105-
sx={{ color: 'white' }}
107+
sx={sidebarButtonStyle}
106108
/>
107109

108-
{/* TODO - explore https://primer.style/components/selectpanel/react/alpha/ for a better UI for filters */}
109110
{isLoggedIn && (
110111
<IconButton
111112
icon={FilterIcon}
@@ -117,7 +118,7 @@ export const Sidebar: FC = () => {
117118
tooltipDirection="e"
118119
onClick={() => toggleFilters()}
119120
data-testid="sidebar-filter-notifications"
120-
sx={{ color: 'white' }}
121+
sx={sidebarButtonStyle}
121122
/>
122123
)}
123124

@@ -130,7 +131,7 @@ export const Sidebar: FC = () => {
130131
tooltipDirection="e"
131132
onClick={() => openGitHubIssues(primaryAccountHostname)}
132133
data-testid="sidebar-my-issues"
133-
sx={{ color: 'white' }}
134+
sx={sidebarButtonStyle}
134135
/>
135136

136137
<IconButton
@@ -142,7 +143,7 @@ export const Sidebar: FC = () => {
142143
tooltipDirection="e"
143144
onClick={() => openGitHubPulls(primaryAccountHostname)}
144145
data-testid="sidebar-my-pull-requests"
145-
sx={{ color: 'white' }}
146+
sx={sidebarButtonStyle}
146147
/>
147148
</Stack>
148149

@@ -166,7 +167,7 @@ export const Sidebar: FC = () => {
166167
disabled={status === 'loading'}
167168
onClick={() => refreshNotifications()}
168169
data-testid="sidebar-refresh"
169-
sx={{ color: 'white' }}
170+
sx={sidebarButtonStyle}
170171
/>
171172

172173
<IconButton
@@ -178,7 +179,7 @@ export const Sidebar: FC = () => {
178179
tooltipDirection="e"
179180
onClick={() => toggleSettings()}
180181
data-testid="sidebar-settings"
181-
sx={{ color: 'white' }}
182+
sx={sidebarButtonStyle}
182183
/>
183184
</>
184185
)}
@@ -193,7 +194,7 @@ export const Sidebar: FC = () => {
193194
tooltipDirection="e"
194195
onClick={() => quitApp()}
195196
data-testid="sidebar-quit"
196-
sx={{ color: 'white' }}
197+
sx={sidebarButtonStyle}
197198
/>
198199
)}
199200
</Stack>

src/renderer/components/__snapshots__/Sidebar.test.tsx.snap

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/renderer/routes/Accounts.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -175,11 +175,9 @@ export const AccountsRoute: FC = () => {
175175
onClick={() => openDeveloperSettings(account)}
176176
size="small"
177177
data-testid="account-missing-scopes"
178-
sx={{
179-
visibility: account.hasRequiredScopes
180-
? 'hidden'
181-
: 'visible',
182-
}}
178+
className={
179+
account.hasRequiredScopes ? 'invisible' : 'visible'
180+
}
183181
/>
184182

185183
<IconButton

src/renderer/routes/Settings.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export const SettingsRoute: FC = () => {
4040
variant="danger"
4141
onClick={() => setIsOpen(!isOpen)}
4242
data-testid="settings-reset"
43-
sx={{ width: '200px' }} // Set the width of the button
43+
sx={{ width: '200px' }}
4444
>
4545
Reset Settings
4646
</Button>

src/renderer/routes/__snapshots__/Accounts.test.tsx.snap

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)