diff --git a/site/src/AppRouter.tsx b/site/src/AppRouter.tsx
index 3ce48bd651934..459998d53aa2d 100644
--- a/site/src/AppRouter.tsx
+++ b/site/src/AppRouter.tsx
@@ -153,22 +153,14 @@ export const AppRouter: FC = () => {
} />
} />
-
-
-
- }
- />
-
-
-
- }
- />
+ }>
+ } />
+ }
+ />
+
+
} />
} />
@@ -178,26 +170,18 @@ export const AppRouter: FC = () => {
-
-
-
- }
- />
+ }>
+ } />
+
+
} />
-
-
-
- }
- />
+ }>
+ } />
+
+
} />
} />
} />
@@ -219,118 +203,22 @@ export const AppRouter: FC = () => {
/>
-
-
-
-
-
-
- }
- />
-
-
-
-
-
- }
- />
-
-
-
-
-
- }
- />
-
-
-
-
-
- }
- />
-
-
-
-
-
- }
- />
-
-
-
-
-
- }
- />
+ }
+ >
+ } />
+ } />
+ } />
+ } />
+ } />
+ } />
-
-
-
-
- }
- />
-
-
-
- }
- />
-
-
-
- }
- />
+ }>
+ } />
+ } />
+ } />
@@ -349,11 +237,11 @@ export const AppRouter: FC = () => {
-
-
- } />
-
-
+ {/* Terminal page don't have the dashboard layout */}
+ }
+ />
{/* Using path="*"" means "match anything", so this route
diff --git a/site/src/components/DeploySettingsLayout/DeploySettingsLayout.tsx b/site/src/components/DeploySettingsLayout/DeploySettingsLayout.tsx
index 08958ebf5f698..87f5f46355ea1 100644
--- a/site/src/components/DeploySettingsLayout/DeploySettingsLayout.tsx
+++ b/site/src/components/DeploySettingsLayout/DeploySettingsLayout.tsx
@@ -2,17 +2,14 @@ import { makeStyles } from "@material-ui/core/styles"
import { Margins } from "components/Margins/Margins"
import { Stack } from "components/Stack/Stack"
import { Sidebar } from "./Sidebar"
-import {
- createContext,
- PropsWithChildren,
- Suspense,
- useContext,
- FC,
-} from "react"
+import { createContext, Suspense, useContext, FC } from "react"
import { useMachine } from "@xstate/react"
import { Loader } from "components/Loader/Loader"
import { DeploymentConfig } from "api/typesGenerated"
import { deploymentConfigMachine } from "xServices/deploymentConfig/deploymentConfigMachine"
+import { RequirePermission } from "components/RequirePermission/RequirePermission"
+import { usePermissions } from "hooks/usePermissions"
+import { Outlet } from "react-router-dom"
type DeploySettingsContextValue = { deploymentConfig: DeploymentConfig }
@@ -30,28 +27,33 @@ export const useDeploySettings = (): DeploySettingsContextValue => {
return context
}
-export const DeploySettingsLayout: FC = ({ children }) => {
+export const DeploySettingsLayout: FC = () => {
const [state] = useMachine(deploymentConfigMachine)
const styles = useStyles()
const { deploymentConfig } = state.context
+ const permissions = usePermissions()
return (
-
-
-
-
- {deploymentConfig ? (
-
- }>{children}
-
- ) : (
-
- )}
-
-
-
+
+
+
+
+
+ {deploymentConfig ? (
+
+ }>
+
+
+
+ ) : (
+
+ )}
+
+
+
+
)
}
diff --git a/site/src/components/DeploySettingsLayout/Sidebar.tsx b/site/src/components/DeploySettingsLayout/Sidebar.tsx
index 72a0c6661b823..013e1502e3e10 100644
--- a/site/src/components/DeploySettingsLayout/Sidebar.tsx
+++ b/site/src/components/DeploySettingsLayout/Sidebar.tsx
@@ -43,37 +43,34 @@ export const Sidebar: React.FC = () => {
return (