1
1
import React , { Component , Fragment } from 'react' ;
2
+ import { ThemeProvider } from '@emotion/react' ;
2
3
import styled from '@emotion/styled' ;
3
4
import * as Sentry from '@sentry/react' ;
4
5
import Cookies from 'js-cookie' ;
@@ -16,7 +17,7 @@ import {
16
17
promptsUpdate ,
17
18
} from 'sentry/actionCreators/prompts' ;
18
19
import type { Client } from 'sentry/api' ;
19
- import { Alert } from 'sentry/components/core/alert' ;
20
+ import { Alert , type AlertProps } from 'sentry/components/core/alert' ;
20
21
import { Badge } from 'sentry/components/core/badge' ;
21
22
import { Button } from 'sentry/components/core/button' ;
22
23
import { ButtonBar } from 'sentry/components/core/button/buttonBar' ;
@@ -33,6 +34,7 @@ import type {Organization} from 'sentry/types/organization';
33
34
import { isActiveSuperuser } from 'sentry/utils/isActiveSuperuser' ;
34
35
import { Oxfordize } from 'sentry/utils/oxfordizeArray' ;
35
36
import { promptIsDismissed } from 'sentry/utils/promptIsDismissed' ;
37
+ import { useInvertedTheme } from 'sentry/utils/theme/useInvertedTheme' ;
36
38
import normalizeUrl from 'sentry/utils/url/normalizeUrl' ;
37
39
import { useNavigate } from 'sentry/utils/useNavigate' ;
38
40
import withApi from 'sentry/utils/withApi' ;
@@ -1151,7 +1153,7 @@ class GSBanner extends Component<Props, State> {
1151
1153
updateUrl : (
1152
1154
< LinkButton
1153
1155
to = { billingUrl }
1154
- size = "xs "
1156
+ size = "zero "
1155
1157
priority = "default"
1156
1158
aria-label = { t ( 'Update payment information' ) }
1157
1159
onClick = { addButtonAnalytics }
@@ -1165,7 +1167,7 @@ class GSBanner extends Component<Props, State> {
1165
1167
updateUrl : (
1166
1168
< LinkButton
1167
1169
to = { membersPageUrl }
1168
- size = "xs "
1170
+ size = "zero "
1169
1171
priority = "default"
1170
1172
aria-label = { t ( 'Org Owner or Billing Member' ) }
1171
1173
onClick = { addButtonAnalytics }
@@ -1262,8 +1264,21 @@ export default withPromotions(withApi(withSubscription(GSBanner, {noLoader: true
1262
1264
1263
1265
// XXX: We have no alert types with this styling, but for now we would like for
1264
1266
// it to be differentiated.
1265
- const BannerAlert = styled ( Alert ) `
1267
+ const StyledBannerAlert = styled ( Alert ) `
1266
1268
color: ${ p => p . theme . headerBackground } ;
1267
- background-color: ${ p => p . theme . bannerBackground } ;
1269
+ background-color: ${ p => p . theme . gray500 } ;
1268
1270
border: none;
1269
1271
` ;
1272
+
1273
+ function BannerAlert ( props : AlertProps ) {
1274
+ const invertedTheme = useInvertedTheme ( ) ;
1275
+
1276
+ if ( invertedTheme . isChonk ) {
1277
+ return (
1278
+ < ThemeProvider theme = { invertedTheme } >
1279
+ < Alert { ...props } />
1280
+ </ ThemeProvider >
1281
+ ) ;
1282
+ }
1283
+ return < StyledBannerAlert { ...props } /> ;
1284
+ }
0 commit comments