File tree 5 files changed +22
-25
lines changed
static/app/components/devtoolbar/components
5 files changed +22
-25
lines changed Original file line number Diff line number Diff line change
1
+ import IndicatorBadge from 'sentry/components/devtoolbar/components/indicatorBadge' ;
2
+
3
+ import useAlertsCount from './useAlertsCount' ;
4
+
5
+ export default function AlertBadge ( ) {
6
+ const { data : count } = useAlertsCount ( ) ;
7
+
8
+ if ( count === undefined || count < 1 ) {
9
+ return null ;
10
+ }
11
+ return < IndicatorBadge variant = "red" /> ;
12
+ }
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
- import type React from 'react' ;
2
1
import { css } from '@emotion/react' ;
3
2
4
3
import { smallCss } from '../styles/typography' ;
@@ -11,26 +10,25 @@ const variants = {
11
10
} ;
12
11
13
12
interface Props {
14
- icon : React . ReactNode ;
15
13
variant : keyof typeof variants ;
16
14
}
17
15
18
- export default function IndicatorBadge ( { icon , variant} : Props ) {
19
- return < div css = { [ smallCss , counterCss , variants [ variant ] ] } > { icon } </ div > ;
16
+ export default function IndicatorBadge ( { variant} : Props ) {
17
+ return < div css = { [ smallCss , badgeCss , variants [ variant ] ] } / >;
20
18
}
21
19
22
- const counterCss = css `
20
+ const badgeCss = css `
23
21
background : var (--red400 );
24
22
border-radius : 50% ;
25
23
border : 1px solid transparent;
26
24
box-sizing : content-box;
27
25
color : var (--gray100 );
28
- height : 1 rem ;
26
+ height : 0.55 rem ;
29
27
line-height : 1rem ;
30
28
position : absolute;
31
- right : -6 px ;
32
- top : -6 px ;
33
- width : 1 rem ;
29
+ right : 2 px ;
30
+ top : 18 px ;
31
+ width : 0.55 rem ;
34
32
display : flex;
35
33
align-items : center;
36
34
justify-content : center;
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ import useToolbarRoute from '../hooks/useToolbarRoute';
18
18
import { navigationCss } from '../styles/navigation' ;
19
19
import { resetDialogCss } from '../styles/reset' ;
20
20
21
- import AlertCountBadge from './alerts/alertCountBadge ' ;
21
+ import AlertBadge from './alerts/alertBadge ' ;
22
22
import IconButton from './navigation/iconButton' ;
23
23
24
24
export default function Navigation ( {
@@ -55,7 +55,7 @@ export default function Navigation({
55
55
< NavButton panelName = "issues" label = "Issues" icon = { < IconIssues /> } />
56
56
< NavButton panelName = "feedback" label = "User Feedback" icon = { < IconMegaphone /> } />
57
57
< NavButton panelName = "alerts" label = "Active Alerts" icon = { < IconSiren /> } >
58
- < AlertCountBadge />
58
+ < AlertBadge />
59
59
</ NavButton >
60
60
< NavButton panelName = "featureFlags" label = "Feature Flags" icon = { < IconFlag /> } />
61
61
< NavButton panelName = "releases" label = "Releases" icon = { < IconReleases /> } >
Original file line number Diff line number Diff line change 1
1
import IndicatorBadge from 'sentry/components/devtoolbar/components/indicatorBadge' ;
2
2
import useSessionStatus from 'sentry/components/devtoolbar/components/releases/useSessionStatus' ;
3
- import { IconFire } from 'sentry/icons' ;
4
3
5
4
export default function CrashCountBadge ( ) {
6
5
const { data} = useSessionStatus ( ) ;
@@ -18,7 +17,7 @@ export default function CrashCountBadge() {
18
17
19
18
// over 10% of sessions were crashes
20
19
if ( crashPercent > 10 ) {
21
- return < IndicatorBadge icon = { < IconFire size = "xs" /> } variant = "red" /> ;
20
+ return < IndicatorBadge variant = "red" /> ;
22
21
}
23
22
return null ;
24
23
}
You can’t perform that action at this time.
0 commit comments