Skip to content

Commit 5b5430b

Browse files
author
Simon Emms
committed
[dashboard]: create a settings tab inside admin
1 parent 39b5c54 commit 5b5430b

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

components/dashboard/src/App.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ const InstallGitHubApp = React.lazy(() => import(/* webpackPrefetch: true */ './
4949
const FromReferrer = React.lazy(() => import(/* webpackPrefetch: true */ './FromReferrer'));
5050
const UserSearch = React.lazy(() => import(/* webpackPrefetch: true */ './admin/UserSearch'));
5151
const WorkspacesSearch = React.lazy(() => import(/* webpackPrefetch: true */ './admin/WorkspacesSearch'));
52+
const AdminSettings = React.lazy(() => import(/* webpackPrefetch: true */ './admin/Settings'));
5253
const OAuthClientApproval = React.lazy(() => import(/* webpackPrefetch: true */ './OauthClientApproval'));
5354

5455
function Loading() {
@@ -276,6 +277,7 @@ function App() {
276277

277278
<Route path="/admin/users" component={UserSearch} />
278279
<Route path="/admin/workspaces" component={WorkspacesSearch} />
280+
<Route path="/admin/settings" component={AdminSettings} />
279281

280282
<Route path={["/", "/login"]} exact>
281283
<Redirect to="/workspaces" />
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { useContext } from "react";
2+
import CheckBox from "../components/CheckBox";
3+
import { PageWithSubMenu } from "../components/PageWithSubMenu";
4+
import { UserContext } from "../user-context";
5+
import { adminMenu } from "./admin-menu";
6+
7+
export default function Settings() {
8+
const { user } = useContext(UserContext);
9+
10+
console.log({ user })
11+
12+
return (
13+
<div>
14+
<PageWithSubMenu subMenu={adminMenu} title="Settings" subtitle="Configure settings for your Gitpod cluster.">
15+
<CheckBox
16+
title="Send anonymous telemetry to Gitpod"
17+
desc="This telemetry is used to provide insights on how you use your cluster so we can provide a better overall experience"
18+
checked={true} />
19+
</PageWithSubMenu>
20+
</div>
21+
)
22+
}

components/dashboard/src/admin/admin-menu.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,7 @@ export const adminMenu = [{
1010
}, {
1111
title: 'Workspaces',
1212
link: ['/admin/workspaces']
13+
}, {
14+
title: 'Settings',
15+
link: ['/admin/settings']
1316
},];

0 commit comments

Comments
 (0)