File tree 6 files changed +38
-23
lines changed
components/FeatureStageBadge
6 files changed +38
-23
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ import { docs } from "utils/docs";
10
10
* All types of feature that we are currently supporting. Defined as record to
11
11
* ensure that we can't accidentally make typos when writing the badge text.
12
12
*/
13
- const featureStageBadgeTypes = {
13
+ export const featureStageBadgeTypes = {
14
14
beta : "beta" ,
15
15
experimental : "experimental" ,
16
16
} as const satisfies Record < string , ReactNode > ;
Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ export const NotificationsPage: FC = () => {
43
43
title = "Notifications"
44
44
description = "Control delivery methods for notifications on this deployment."
45
45
layout = "fluid"
46
+ featureStage = { "beta" }
46
47
>
47
48
< Tabs active = { tab } >
48
49
< TabsList >
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ import {
14
14
} from "components/Sidebar/Sidebar" ;
15
15
import { useDashboard } from "modules/dashboard/useDashboard" ;
16
16
import type { FC } from "react" ;
17
+ import { FeatureStageBadge } from "components/FeatureStageBadge/FeatureStageBadge" ;
17
18
18
19
export const Sidebar : FC = ( ) => {
19
20
const { experiments } = useDashboard ( ) ;
@@ -51,11 +52,9 @@ export const Sidebar: FC = () => {
51
52
< SidebarNavItem href = "observability" icon = { InsertChartIcon } >
52
53
Observability
53
54
</ SidebarNavItem >
54
- { experiments . includes ( "notifications" ) && (
55
- < SidebarNavItem href = "notifications" icon = { NotificationsIcon } >
56
- Notifications
57
- </ SidebarNavItem >
58
- ) }
55
+ < SidebarNavItem href = "notifications" icon = { NotificationsIcon } >
56
+ Notifications < FeatureStageBadge contentType = "beta" size = "sm" />
57
+ </ SidebarNavItem >
59
58
</ BaseSidebar >
60
59
) ;
61
60
} ;
Original file line number Diff line number Diff line change @@ -148,11 +148,12 @@ const DeploymentSettingsNavigation: FC<DeploymentSettingsNavigationProps> = ({
148
148
Users
149
149
</ SidebarNavSubItem >
150
150
) }
151
- { experiments . includes ( "notifications" ) && (
151
+ < Stack direction = { "row" } alignItems = { "center" } css = { { gap : 0 } } >
152
152
< SidebarNavSubItem href = "notifications" >
153
153
Notifications
154
154
</ SidebarNavSubItem >
155
- ) }
155
+ < FeatureStageBadge contentType = "beta" size = "sm" />
156
+ </ Stack >
156
157
</ Stack >
157
158
) }
158
159
</ div >
Original file line number Diff line number Diff line change 1
1
import type { Interpolation , Theme } from "@emotion/react" ;
2
+ import {
3
+ FeatureStageBadge ,
4
+ type featureStageBadgeTypes ,
5
+ } from "components/FeatureStageBadge/FeatureStageBadge" ;
6
+ import { Stack } from "components/Stack/Stack" ;
2
7
import type { FC , ReactNode } from "react" ;
3
8
4
9
type SectionLayout = "fixed" | "fluid" ;
@@ -13,6 +18,7 @@ export interface SectionProps {
13
18
layout ?: SectionLayout ;
14
19
className ?: string ;
15
20
children ?: ReactNode ;
21
+ featureStage ?: keyof typeof featureStageBadgeTypes ;
16
22
}
17
23
18
24
export const Section : FC < SectionProps > = ( {
@@ -24,6 +30,7 @@ export const Section: FC<SectionProps> = ({
24
30
className = "" ,
25
31
children,
26
32
layout = "fixed" ,
33
+ featureStage,
27
34
} ) => {
28
35
return (
29
36
< section className = { className } id = { id } data-testid = { id } >
@@ -32,16 +39,25 @@ export const Section: FC<SectionProps> = ({
32
39
< div css = { styles . header } >
33
40
< div >
34
41
{ title && (
35
- < h4
36
- css = { {
37
- fontSize : 24 ,
38
- fontWeight : 500 ,
39
- margin : 0 ,
40
- marginBottom : 8 ,
41
- } }
42
- >
43
- { title }
44
- </ h4 >
42
+ < Stack direction = { "row" } alignItems = "center" >
43
+ < h4
44
+ css = { {
45
+ fontSize : 24 ,
46
+ fontWeight : 500 ,
47
+ margin : 0 ,
48
+ marginBottom : 8 ,
49
+ } }
50
+ >
51
+ { title }
52
+ </ h4 >
53
+ { featureStage && (
54
+ < FeatureStageBadge
55
+ contentType = { featureStage }
56
+ size = "lg"
57
+ css = { { marginBottom : "5px" } }
58
+ />
59
+ ) }
60
+ </ Stack >
45
61
) }
46
62
{ description && typeof description === "string" && (
47
63
< p css = { styles . description } > { description } </ p >
Original file line number Diff line number Diff line change @@ -57,11 +57,9 @@ export const Sidebar: FC<SidebarProps> = ({ user }) => {
57
57
< SidebarNavItem href = "tokens" icon = { VpnKeyOutlined } >
58
58
Tokens
59
59
</ SidebarNavItem >
60
- { experiments . includes ( "notifications" ) && (
61
- < SidebarNavItem href = "notifications" icon = { NotificationsIcon } >
62
- Notifications
63
- </ SidebarNavItem >
64
- ) }
60
+ < SidebarNavItem href = "notifications" icon = { NotificationsIcon } >
61
+ Notifications
62
+ </ SidebarNavItem >
65
63
</ BaseSidebar >
66
64
) ;
67
65
} ;
You can’t perform that action at this time.
0 commit comments