File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed
views/nav/secondary/sections/explore Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -227,6 +227,7 @@ function Sidebar() {
227
227
to = { `/organizations/${ organization ?. slug } /explore/logs/` }
228
228
id = "ourlogs"
229
229
icon = { < SubitemDot collapsed /> }
230
+ isNew
230
231
/>
231
232
</ Feature >
232
233
) ;
Original file line number Diff line number Diff line change 1
1
import Feature from 'sentry/components/acl/feature' ;
2
+ import { FeatureBadge } from 'sentry/components/core/badge/featureBadge' ;
2
3
import { t } from 'sentry/locale' ;
4
+ import localStorage from 'sentry/utils/localStorage' ;
3
5
import { useLocation } from 'sentry/utils/useLocation' ;
4
6
import useOrganization from 'sentry/utils/useOrganization' ;
5
7
import { useGetSavedQueries } from 'sentry/views/explore/hooks/useGetSavedQueries' ;
@@ -22,6 +24,9 @@ export function ExploreSecondaryNav() {
22
24
perPage : MAX_STARRED_QUERIES_DISPLAYED ,
23
25
} ) ;
24
26
27
+ const ourlogsSeenKey = `sidebar-new-seen:ourlogs` ;
28
+ const showOurlogsNew = ! localStorage . getItem ( ourlogsSeenKey ) ;
29
+
25
30
return (
26
31
< SecondaryNav >
27
32
< SecondaryNav . Header >
@@ -39,7 +44,17 @@ export function ExploreSecondaryNav() {
39
44
</ SecondaryNav . Item >
40
45
</ Feature >
41
46
< Feature features = "ourlogs-enabled" >
42
- < SecondaryNav . Item to = { `${ baseUrl } /logs/` } analyticsItemName = "explore_logs" >
47
+ < SecondaryNav . Item
48
+ to = { `${ baseUrl } /logs/` }
49
+ analyticsItemName = "explore_logs"
50
+ trailingItems = { showOurlogsNew ? < FeatureBadge type = "new" /> : null }
51
+ onMouseDown = { ( ) => {
52
+ localStorage . setItem ( ourlogsSeenKey , 'true' ) ;
53
+ } }
54
+ onTouchStart = { ( ) => {
55
+ localStorage . setItem ( ourlogsSeenKey , 'true' ) ;
56
+ } }
57
+ >
43
58
{ t ( 'Logs' ) }
44
59
</ SecondaryNav . Item >
45
60
</ Feature >
You can’t perform that action at this time.
0 commit comments