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
120
120
121
121
exports [` getNotificationTypeIconColor should format the notification color for check suite 4` ] = ` "text-green-500"` ;
122
122
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 "` ;
124
124
125
125
exports [` getNotificationTypeIconColor should format the notification color for state 1` ] = ` "text-green-500"` ;
126
126
127
127
exports [` getNotificationTypeIconColor should format the notification color for state 2` ] = ` "text-red-500"` ;
128
128
129
129
exports [` getNotificationTypeIconColor should format the notification color for state 3` ] = ` "text-purple-500"` ;
130
130
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 "` ;
132
132
133
133
exports [` getNotificationTypeIconColor should format the notification color for state 5` ] = ` "text-purple-500"` ;
134
134
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 "` ;
136
136
137
137
exports [` getNotificationTypeIconColor should format the notification color for state 7` ] = ` "text-green-500"` ;
138
138
139
139
exports [` getNotificationTypeIconColor should format the notification color for state 8` ] = ` "text-green-500"` ;
140
140
141
141
exports [` getNotificationTypeIconColor should format the notification color for state 9` ] = ` "text-purple-500"` ;
142
142
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 1
1
import { Appearance } from '../types' ;
2
2
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
+
3
11
export const setLightMode = ( ) =>
4
12
document . querySelector ( 'html' ) . classList . remove ( 'dark' ) ;
5
13
Original file line number Diff line number Diff line change @@ -25,6 +25,8 @@ import {
25
25
XIcon ,
26
26
} from '@primer/octicons-react' ;
27
27
import { Reason , Subject } from '../typesGithub' ;
28
+ import { Appearance } from '../types' ;
29
+ import { getAppearance } from './appearance' ;
28
30
29
31
// prettier-ignore
30
32
const DESCRIPTIONS = {
@@ -157,33 +159,23 @@ export function getNotificationTypeIcon(
157
159
158
160
export function getNotificationTypeIconColor ( subject : Subject ) : string {
159
161
switch ( subject . state ) {
162
+ case 'open' :
163
+ case 'reopened' :
160
164
case 'ANSWERED' :
165
+ case 'success' :
161
166
return 'text-green-500' ;
162
- case 'cancelled' :
163
- return 'text-gray-500' ;
164
167
case 'closed' :
165
- return 'text-red-500' ;
166
- case 'completed' :
167
- return 'text-purple-500' ;
168
- case 'draft' :
169
- return 'text-gray-600' ;
170
168
case 'failure' :
171
169
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' :
180
171
case 'RESOLVED' :
172
+ case 'merged' :
181
173
return 'text-purple-500' ;
182
- case 'skipped' :
183
- return 'text-gray-500' ;
184
- case 'success' :
185
- return 'text-green-500' ;
186
174
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' ;
188
180
}
189
181
}
You can’t perform that action at this time.
0 commit comments