From 4bb886c44c0bc1027a11b338d174029f6eca4227 Mon Sep 17 00:00:00 2001 From: Adam Setch Date: Fri, 5 Apr 2024 17:32:59 +0000 Subject: [PATCH] refactor: simplify default icon color (#963) --- src/utils/__snapshots__/github-api.test.ts.snap | 12 ++++++------ src/utils/github-api.ts | 8 +------- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/src/utils/__snapshots__/github-api.test.ts.snap b/src/utils/__snapshots__/github-api.test.ts.snap index b12b53e88..78694ee93 100644 --- a/src/utils/__snapshots__/github-api.test.ts.snap +++ b/src/utils/__snapshots__/github-api.test.ts.snap @@ -112,15 +112,15 @@ 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"`; @@ -128,11 +128,11 @@ exports[`utils/github-api.ts getNotificationTypeIconColor should format the noti 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"`; @@ -140,4 +140,4 @@ exports[`utils/github-api.ts getNotificationTypeIconColor should format the noti 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"`; diff --git a/src/utils/github-api.ts b/src/utils/github-api.ts index 21b2fd7d3..ca0253260 100644 --- a/src/utils/github-api.ts +++ b/src/utils/github-api.ts @@ -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 = { @@ -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'; } }