File tree Expand file tree Collapse file tree 3 files changed +24
-24
lines changed Expand file tree Collapse file tree 3 files changed +24
-24
lines changed Original file line number Diff line number Diff line change @@ -120,24 +120,24 @@ exports[`getNotificationTypeIconColor should format the notification color for c
120120
121121exports [` getNotificationTypeIconColor should format the notification color for check suite 4` ] = ` "text-green-500"` ;
122122
123- exports [` getNotificationTypeIconColor should format the notification color for check suite 5` ] = ` "text-gray-300 "` ;
123+ exports [` getNotificationTypeIconColor should format the notification color for check suite 5` ] = ` "text-gray-500 "` ;
124124
125125exports [` getNotificationTypeIconColor should format the notification color for state 1` ] = ` "text-green-500"` ;
126126
127127exports [` getNotificationTypeIconColor should format the notification color for state 2` ] = ` "text-red-500"` ;
128128
129129exports [` getNotificationTypeIconColor should format the notification color for state 3` ] = ` "text-purple-500"` ;
130130
131- exports [` getNotificationTypeIconColor should format the notification color for state 4` ] = ` "text-gray-600 "` ;
131+ exports [` getNotificationTypeIconColor should format the notification color for state 4` ] = ` "text-gray-500 "` ;
132132
133133exports [` getNotificationTypeIconColor should format the notification color for state 5` ] = ` "text-purple-500"` ;
134134
135- exports [` getNotificationTypeIconColor should format the notification color for state 6` ] = ` "text-gray-300 "` ;
135+ exports [` getNotificationTypeIconColor should format the notification color for state 6` ] = ` "text-gray-500 "` ;
136136
137137exports [` getNotificationTypeIconColor should format the notification color for state 7` ] = ` "text-green-500"` ;
138138
139139exports [` getNotificationTypeIconColor should format the notification color for state 8` ] = ` "text-green-500"` ;
140140
141141exports [` getNotificationTypeIconColor should format the notification color for state 9` ] = ` "text-purple-500"` ;
142142
143- exports [` getNotificationTypeIconColor should format the notification color for state 10` ] = ` "text-gray-300 "` ;
143+ exports [` getNotificationTypeIconColor should format the notification color for state 10` ] = ` "text-gray-500 "` ;
Original file line number Diff line number Diff line change 11import { Appearance } from '../types' ;
22
3+ export function getAppearance ( ) : Appearance {
4+ if ( document . querySelector ( 'html' ) . classList . contains ( 'dark' ) ) {
5+ return Appearance . DARK ;
6+ }
7+
8+ return Appearance . LIGHT ;
9+ }
10+
311export const setLightMode = ( ) =>
412 document . querySelector ( 'html' ) . classList . remove ( 'dark' ) ;
513
Original file line number Diff line number Diff line change @@ -25,6 +25,8 @@ import {
2525 XIcon ,
2626} from '@primer/octicons-react' ;
2727import { Reason , Subject } from '../typesGithub' ;
28+ import { Appearance } from '../types' ;
29+ import { getAppearance } from './appearance' ;
2830
2931// prettier-ignore
3032const DESCRIPTIONS = {
@@ -157,33 +159,23 @@ export function getNotificationTypeIcon(
157159
158160export function getNotificationTypeIconColor ( subject : Subject ) : string {
159161 switch ( subject . state ) {
162+ case 'open' :
163+ case 'reopened' :
160164 case 'ANSWERED' :
165+ case 'success' :
161166 return 'text-green-500' ;
162- case 'cancelled' :
163- return 'text-gray-500' ;
164167 case 'closed' :
165- return 'text-red-500' ;
166- case 'completed' :
167- return 'text-purple-500' ;
168- case 'draft' :
169- return 'text-gray-600' ;
170168 case 'failure' :
171169 return 'text-red-500' ;
172- case 'merged' :
173- return 'text-purple-500' ;
174- case 'not_planned' :
175- return 'text-gray-300' ;
176- case 'open' :
177- return 'text-green-500' ;
178- case 'reopened' :
179- return 'text-green-500' ;
170+ case 'completed' :
180171 case 'RESOLVED' :
172+ case 'merged' :
181173 return 'text-purple-500' ;
182- case 'skipped' :
183- return 'text-gray-500' ;
184- case 'success' :
185- return 'text-green-500' ;
186174 default :
187- return 'text-gray-300' ;
175+ const appearance = getAppearance ( ) ;
176+ if ( appearance == Appearance . DARK ) {
177+ return 'text-gray-300' ;
178+ }
179+ return 'text-gray-500' ;
188180 }
189181}
You can’t perform that action at this time.
0 commit comments