@@ -13,6 +13,7 @@ import { type ClassName, useClassName } from "hooks/useClassName";
13
13
import { useDashboard } from "modules/dashboard/useDashboard" ;
14
14
import type { FC , ReactNode } from "react" ;
15
15
import { Link , NavLink } from "react-router-dom" ;
16
+ import { useFeatureVisibility } from "modules/dashboard/useFeatureVisibility" ;
16
17
17
18
export interface OrganizationWithPermissions extends Organization {
18
19
permissions : AuthorizationResponse ;
@@ -39,6 +40,7 @@ export const SidebarView: FC<SidebarProps> = ({
39
40
permissions,
40
41
} ) => {
41
42
const { showOrganizations } = useDashboard ( ) ;
43
+ const { multiple_organizations : hasPremiumLicense } = useFeatureVisibility ( ) ;
42
44
43
45
// TODO: Do something nice to scroll to the active org.
44
46
return (
@@ -52,6 +54,7 @@ export const SidebarView: FC<SidebarProps> = ({
52
54
< DeploymentSettingsNavigation
53
55
active = { ! activeOrganizationName && activeSettings }
54
56
permissions = { permissions }
57
+ isPremium = { hasPremiumLicense }
55
58
/>
56
59
{ showOrganizations && (
57
60
< OrganizationsSettingsNavigation
@@ -69,6 +72,7 @@ interface DeploymentSettingsNavigationProps {
69
72
active : boolean ;
70
73
/** Site-wide permissions. */
71
74
permissions : Permissions ;
75
+ isPremium : boolean ;
72
76
}
73
77
74
78
/**
@@ -81,6 +85,7 @@ interface DeploymentSettingsNavigationProps {
81
85
const DeploymentSettingsNavigation : FC < DeploymentSettingsNavigationProps > = ( {
82
86
active,
83
87
permissions,
88
+ isPremium,
84
89
} ) => {
85
90
return (
86
91
< div css = { { paddingBottom : 12 } } >
@@ -150,7 +155,9 @@ const DeploymentSettingsNavigation: FC<DeploymentSettingsNavigationProps> = ({
150
155
</ Stack >
151
156
</ SidebarNavSubItem >
152
157
) }
153
- < SidebarNavSubItem href = "premium" > Premium</ SidebarNavSubItem >
158
+ { ! isPremium && (
159
+ < SidebarNavSubItem href = "premium" > Premium</ SidebarNavSubItem >
160
+ ) }
154
161
</ Stack >
155
162
) }
156
163
</ div >
0 commit comments