@@ -5,9 +5,9 @@ import Link from "@mui/material/Link";
55import List from "@mui/material/List" ;
66import ListItem from "@mui/material/ListItem" ;
77import Typography from "@mui/material/Typography" ;
8+ import { RootContext } from "~/pages/Root.context" ;
89import { AppContext } from "~/pages/apps/[id]/App.context" ;
910import { EnvironmentContext } from "~/pages/apps/[id]/environments/Environment.context" ;
10- import { isSelfHosted } from "~/utils/helpers/instance" ;
1111import TabDomainConfig from "./_components/TabDomainConfig/TabDomainConfig" ;
1212import TabConfigEnvVars from "./_components/TabConfigEnvVars" ;
1313import TabConfigGeneral from "./_components/TabConfigGeneral" ;
@@ -21,8 +21,6 @@ import TabAPIKey from "./_components/TabAPIKey";
2121import TabMailer from "./_components/TabMailer" ;
2222import TabAuthWall from "./_components/TabAuthWall" ;
2323
24- const selfHosted = isSelfHosted ( ) ;
25-
2624interface NavItem {
2725 path : string ;
2826 text : string ;
@@ -34,13 +32,16 @@ interface NavItemParent {
3432 children : NavItem [ ] ;
3533}
3634
37- const generateListItems = ( app : App ) : NavItemParent [ ] => [
35+ const generateListItems = (
36+ app : App ,
37+ edition ?: "self-hosted" | "cloud" | "development"
38+ ) : NavItemParent [ ] => [
3839 {
3940 title : "Deployment settings" ,
4041 children : [
4142 { path : "#general" , text : "General" } ,
4243 { path : "#build" , text : "Build" , visible : ! app . isBare } ,
43- { path : "#server" , text : "Server" , visible : selfHosted } ,
44+ { path : "#server" , text : "Server" , visible : edition === "self-hosted" } ,
4445 { path : "#env-vars" , text : "Environment variables" } ,
4546 { path : "#status-checks" , text : "Status checks" , visible : ! app . isBare } ,
4647 ] . filter ( i => i . visible !== false ) ,
@@ -71,12 +72,13 @@ interface TabProps {
7172}
7273
7374export default function EnvironmentConfig ( ) {
75+ const { details } = useContext ( RootContext ) ;
7476 const [ selectedItem , setSelectedItem ] = useState < string > ( "" ) ;
7577 const { app, setRefreshToken } = useContext ( AppContext ) ;
7678 const { environment } = useContext ( EnvironmentContext ) ;
7779 const { hash } = useLocation ( ) ;
7880 const listItems = useMemo ( ( ) => {
79- return generateListItems ( app ) ;
81+ return generateListItems ( app , details ?. stormkit ?. edition ) ;
8082 } , [ app ] ) ;
8183 const navigate = useNavigate ( ) ;
8284
@@ -118,7 +120,7 @@ export default function EnvironmentConfig() {
118120 setRefreshToken = { setRefreshToken }
119121 />
120122 ) }
121- { selfHosted && (
123+ { details ?. stormkit ?. edition === "self-hosted" && (
122124 < TabConfigServer
123125 app = { app }
124126 environment = { environment }
0 commit comments