Skip to content

Commit 4b9246f

Browse files
committed
feat: update account scopes icon color
Signed-off-by: Adam Setch <adam.setch@outlook.com>
1 parent b57abc0 commit 4b9246f

1 file changed

Lines changed: 16 additions & 7 deletions

File tree

src/renderer/routes/Accounts.tsx

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import { Page } from '../components/layout/Page';
3030
import { Footer } from '../components/primitives/Footer';
3131
import { Header } from '../components/primitives/Header';
3232

33-
import { type Account, type GitifyError, Size } from '../types';
33+
import { type Account, type GitifyError, IconColor, Size } from '../types';
3434

3535
import { determineFailureType } from '../utils/api/errors';
3636
import {
@@ -258,19 +258,28 @@ export const AccountsRoute: FC = () => {
258258
<IconButton
259259
aria-label={`View scopes for ${account.user.login}`}
260260
data-testid="account-view-scopes"
261-
icon={ShieldCheckIcon}
261+
icon={() => (
262+
<ShieldCheckIcon
263+
className={
264+
hasRecommendedScopes(account)
265+
? IconColor.GREEN
266+
: hasAlternateScopes(account)
267+
? 'text-gitify-warning'
268+
: ''
269+
}
270+
/>
271+
)}
262272
onClick={() =>
263273
navigate('/account-scopes', {
264274
state: { account },
265275
})
266276
}
267277
size="small"
268278
variant={
269-
hasRecommendedScopes(account)
270-
? 'primary'
271-
: hasAlternateScopes(account)
272-
? 'default'
273-
: 'danger'
279+
!hasRecommendedScopes(account) &&
280+
!hasAlternateScopes(account)
281+
? 'danger'
282+
: 'default'
274283
}
275284
/>
276285
)}

0 commit comments

Comments
 (0)