File tree Expand file tree Collapse file tree 5 files changed +22
-25
lines changed
static/app/components/devtoolbar/components Expand file tree Collapse file tree 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' ;
21import { css } from '@emotion/react' ;
32
43import { smallCss } from '../styles/typography' ;
@@ -11,26 +10,25 @@ const variants = {
1110} ;
1211
1312interface Props {
14- icon : React . ReactNode ;
1513 variant : keyof typeof variants ;
1614}
1715
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 ] ] } / >;
2018}
2119
22- const counterCss = css `
20+ const badgeCss = css `
2321 background : var (--red400 );
2422 border-radius : 50% ;
2523 border : 1px solid transparent;
2624 box-sizing : content-box;
2725 color : var (--gray100 );
28- height : 1 rem ;
26+ height : 0.55 rem ;
2927 line-height : 1rem ;
3028 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 ;
3432 display : flex;
3533 align-items : center;
3634 justify-content : center;
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ import useToolbarRoute from '../hooks/useToolbarRoute';
1818import { navigationCss } from '../styles/navigation' ;
1919import { resetDialogCss } from '../styles/reset' ;
2020
21- import AlertCountBadge from './alerts/alertCountBadge ' ;
21+ import AlertBadge from './alerts/alertBadge ' ;
2222import IconButton from './navigation/iconButton' ;
2323
2424export default function Navigation ( {
@@ -55,7 +55,7 @@ export default function Navigation({
5555 < NavButton panelName = "issues" label = "Issues" icon = { < IconIssues /> } />
5656 < NavButton panelName = "feedback" label = "User Feedback" icon = { < IconMegaphone /> } />
5757 < NavButton panelName = "alerts" label = "Active Alerts" icon = { < IconSiren /> } >
58- < AlertCountBadge />
58+ < AlertBadge />
5959 </ NavButton >
6060 < NavButton panelName = "featureFlags" label = "Feature Flags" icon = { < IconFlag /> } />
6161 < NavButton panelName = "releases" label = "Releases" icon = { < IconReleases /> } >
Original file line number Diff line number Diff line change 11import IndicatorBadge from 'sentry/components/devtoolbar/components/indicatorBadge' ;
22import useSessionStatus from 'sentry/components/devtoolbar/components/releases/useSessionStatus' ;
3- import { IconFire } from 'sentry/icons' ;
43
54export default function CrashCountBadge ( ) {
65 const { data} = useSessionStatus ( ) ;
@@ -18,7 +17,7 @@ export default function CrashCountBadge() {
1817
1918 // over 10% of sessions were crashes
2019 if ( crashPercent > 10 ) {
21- return < IndicatorBadge icon = { < IconFire size = "xs" /> } variant = "red" /> ;
20+ return < IndicatorBadge variant = "red" /> ;
2221 }
2322 return null ;
2423}
You can’t perform that action at this time.
0 commit comments