From 12c619aa0ceb7b66af466a92fca465937ca79349 Mon Sep 17 00:00:00 2001 From: Jim Ehrismann Date: Fri, 22 Jan 2021 19:46:59 -0500 Subject: [PATCH] added Select component to landing page title for changing workspace Signed-off-by: Jim Ehrismann --- .../components/+landing-page/landing-page.tsx | 31 ++++++++- .../+landing-page/workspace-overview.tsx | 68 +++++++++++++------ 2 files changed, 77 insertions(+), 22 deletions(-) diff --git a/src/renderer/components/+landing-page/landing-page.tsx b/src/renderer/components/+landing-page/landing-page.tsx index a6925a1f0b..6b50572646 100644 --- a/src/renderer/components/+landing-page/landing-page.tsx +++ b/src/renderer/components/+landing-page/landing-page.tsx @@ -5,7 +5,10 @@ import { observer } from "mobx-react"; import { clusterStore } from "../../../common/cluster-store"; import { Workspace, workspaceStore } from "../../../common/workspace-store"; import { PageLayout } from "../layout/page-layout" +import { Select, SelectOption } from "../select"; import { WorkspaceOverview } from "./workspace-overview" +import { autobind } from "../../../common/utils"; + @observer export class LandingPage extends React.Component { @observable showHint = true; @@ -13,15 +16,37 @@ export class LandingPage extends React.Component { currentWorkspace = autorun(() => { this.workspace = workspaceStore.currentWorkspace; }) + @autobind() + getHeader() { + const onWorkspaceChange = (option: SelectOption) => { + const selectedWorkspace = workspaceStore.getByName(option.value); + + if (!selectedWorkspace) { + return; + } + + workspaceStore.setActive(selectedWorkspace.id); + } + + return ( +

+ Workspace: +