Skip to content

Commit

Permalink
refactor: simplify default icon color (#963)
Browse files Browse the repository at this point in the history
  • Loading branch information
setchy authored Apr 5, 2024
1 parent 61e5c95 commit 4bb886c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
12 changes: 6 additions & 6 deletions src/utils/__snapshots__/github-api.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -112,32 +112,32 @@ exports[`utils/github-api.ts formatReason - should format the notification reaso
}
`;

exports[`utils/github-api.ts getNotificationTypeIconColor should format the notification color for check suite 1`] = `"text-gray-500"`;
exports[`utils/github-api.ts getNotificationTypeIconColor should format the notification color for check suite 1`] = `"text-gray-500 dark:text-gray-300"`;

exports[`utils/github-api.ts getNotificationTypeIconColor should format the notification color for check suite 2`] = `"text-red-500"`;

exports[`utils/github-api.ts getNotificationTypeIconColor should format the notification color for check suite 3`] = `"text-gray-500"`;
exports[`utils/github-api.ts getNotificationTypeIconColor should format the notification color for check suite 3`] = `"text-gray-500 dark:text-gray-300"`;

exports[`utils/github-api.ts getNotificationTypeIconColor should format the notification color for check suite 4`] = `"text-green-500"`;

exports[`utils/github-api.ts getNotificationTypeIconColor should format the notification color for check suite 5`] = `"text-gray-500"`;
exports[`utils/github-api.ts getNotificationTypeIconColor should format the notification color for check suite 5`] = `"text-gray-500 dark:text-gray-300"`;

exports[`utils/github-api.ts getNotificationTypeIconColor should format the notification color for state 1`] = `"text-green-500"`;

exports[`utils/github-api.ts getNotificationTypeIconColor should format the notification color for state 2`] = `"text-red-500"`;

exports[`utils/github-api.ts getNotificationTypeIconColor should format the notification color for state 3`] = `"text-purple-500"`;

exports[`utils/github-api.ts getNotificationTypeIconColor should format the notification color for state 4`] = `"text-gray-500"`;
exports[`utils/github-api.ts getNotificationTypeIconColor should format the notification color for state 4`] = `"text-gray-500 dark:text-gray-300"`;

exports[`utils/github-api.ts getNotificationTypeIconColor should format the notification color for state 5`] = `"text-purple-500"`;

exports[`utils/github-api.ts getNotificationTypeIconColor should format the notification color for state 6`] = `"text-gray-500"`;
exports[`utils/github-api.ts getNotificationTypeIconColor should format the notification color for state 6`] = `"text-gray-500 dark:text-gray-300"`;

exports[`utils/github-api.ts getNotificationTypeIconColor should format the notification color for state 7`] = `"text-green-500"`;

exports[`utils/github-api.ts getNotificationTypeIconColor should format the notification color for state 8`] = `"text-green-500"`;

exports[`utils/github-api.ts getNotificationTypeIconColor should format the notification color for state 9`] = `"text-purple-500"`;

exports[`utils/github-api.ts getNotificationTypeIconColor should format the notification color for state 10`] = `"text-gray-500"`;
exports[`utils/github-api.ts getNotificationTypeIconColor should format the notification color for state 10`] = `"text-gray-500 dark:text-gray-300"`;
8 changes: 1 addition & 7 deletions src/utils/github-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ import {
XIcon,
} from '@primer/octicons-react';
import { Reason, Subject } from '../typesGithub';
import { Theme } from '../types';
import { getTheme } from './theme';

// prettier-ignore
const DESCRIPTIONS = {
Expand Down Expand Up @@ -171,10 +169,6 @@ export function getNotificationTypeIconColor(subject: Subject): string {
case 'merged':
return 'text-purple-500';
default:
const theme = getTheme();
if (theme == Theme.DARK) {
return 'text-gray-300';
}
return 'text-gray-500';
return 'text-gray-500 dark:text-gray-300';
}
}

0 comments on commit 4bb886c

Please sign in to comment.