From 7d1f356d8814815f3ef6a740662f73aaa23404f7 Mon Sep 17 00:00:00 2001 From: Alex Andreev Date: Tue, 9 Mar 2021 15:06:03 +0300 Subject: [PATCH] Moving out from Signed-off-by: Alex Andreev --- .../components/+preferences/preferences.tsx | 167 +++++++++--------- .../components/layout/page-layout.tsx | 52 +++--- 2 files changed, 110 insertions(+), 109 deletions(-) diff --git a/src/renderer/components/+preferences/preferences.tsx b/src/renderer/components/+preferences/preferences.tsx index 8fc3cf9764..a144f8e787 100644 --- a/src/renderer/components/+preferences/preferences.tsx +++ b/src/renderer/components/+preferences/preferences.tsx @@ -14,6 +14,7 @@ import { SubTitle } from "../layout/sub-title"; import { Select, SelectOption } from "../select"; import { HelmCharts } from "./helm-charts"; import { KubectlBinaries } from "./kubectl-binaries"; +import { ScrollSpy } from "../scroll-spy/scroll-spy"; @observer export class Preferences extends React.Component { @@ -31,94 +32,96 @@ export class Preferences extends React.Component { const header =

Preferences

; return ( - -
-
-

Application

-
-
-

Appearance

- - this.httpProxy = v} - onBlur={() => preferences.httpsProxy = this.httpProxy} - /> - - Proxy is used only for non-cluster communication. - + ( + +
+
+

Application

+
+
+

Appearance

+ + this.httpProxy = v} + onBlur={() => preferences.httpsProxy = this.httpProxy} + /> + + Proxy is used only for non-cluster communication. + - - preferences.allowUntrustedCAs = v} - /> - - This will make Lens to trust ANY certificate authority without any validations.{" "} - Needed with some corporate proxies that do certificate re-writing.{" "} - Does not affect cluster communications! - + + preferences.allowUntrustedCAs = v} + /> + + This will make Lens to trust ANY certificate authority without any validations.{" "} + Needed with some corporate proxies that do certificate re-writing.{" "} + Does not affect cluster communications! + +
+
+

Start-up

+ + preferences.openAtLogin = v} + /> +
-
-

Start-up

- - preferences.openAtLogin = v} - /> -
-
-
-
-

Kubernetes

+
+
+

Kubernetes

+
+
+

Kubectl binary

+ +
+
+

Helm Charts

+ +
-
-

Kubectl binary

- -
-
-

Helm Charts

- -
-
-
-
-

Extensions

+
+
+

Extensions

+
+ {appPreferenceRegistry.getItems().map(({ title, components: { Hint, Input } }, index) => { + return ( +
+

{title}

+ + + + +
+ ); + })}
- {appPreferenceRegistry.getItems().map(({ title, components: { Hint, Input } }, index) => { - return ( -
-

{title}

- - - - -
- ); - })} -
- + + )}/> ); } } diff --git a/src/renderer/components/layout/page-layout.tsx b/src/renderer/components/layout/page-layout.tsx index 31d785b36a..cbdb7ef434 100644 --- a/src/renderer/components/layout/page-layout.tsx +++ b/src/renderer/components/layout/page-layout.tsx @@ -5,8 +5,7 @@ import { observer } from "mobx-react"; import { autobind, cssNames, IClassName } from "../../utils"; import { Icon } from "../icon"; import { navigation } from "../../navigation"; -import { ScrollSpy } from "../scroll-spy/scroll-spy"; -import { RecursiveTreeView } from "../tree-view"; +import { NavigationTree, RecursiveTreeView } from "../tree-view"; export interface PageLayoutProps extends React.DOMAttributes { className?: IClassName; @@ -16,7 +15,7 @@ export interface PageLayoutProps extends React.DOMAttributes { provideBackButtonNavigation?: boolean; contentGaps?: boolean; showOnTop?: boolean; // covers whole app view - showNavigation?: boolean; + navigation?: NavigationTree[]; back?: (evt: React.MouseEvent | KeyboardEvent) => void; } @@ -60,36 +59,35 @@ export class PageLayout extends React.Component { render() { const { contentClass, header, headerClass, provideBackButtonNavigation, - contentGaps, showOnTop, showNavigation, children, ...elemProps + contentGaps, showOnTop, navigation, children, ...elemProps } = this.props; - const className = cssNames("PageLayout", { showOnTop, showNavigation }, this.props.className); + const className = cssNames("PageLayout", { showOnTop, showNavigation: navigation }, this.props.className); return ( - ( -
-
- {header} - {provideBackButtonNavigation && ( - +
+
+ {header} + {provideBackButtonNavigation && ( + + )} +
+
+
+ { navigation && ( + )} -
-
-
- { showNavigation && ( - - )} -
- {children} -
+
+ {children}
- )} />); +
+ ); } }