diff --git a/src/renderer/components/+preferences/preferences.tsx b/src/renderer/components/+preferences/preferences.tsx index aa090abda0..691e045582 100644 --- a/src/renderer/components/+preferences/preferences.tsx +++ b/src/renderer/components/+preferences/preferences.tsx @@ -18,7 +18,7 @@ import { navigation } from "../../navigation"; import { Tab, Tabs } from "../tabs"; import { FormSwitch, Switcher } from "../switch"; -enum PreferencesTab { +enum Pages { Application = "application", Proxy = "proxy", Kubernetes = "kubernetes", @@ -31,7 +31,7 @@ enum PreferencesTab { export class Preferences extends React.Component { @observable httpProxy = userStore.preferences.httpsProxy || ""; @observable shell = userStore.preferences.shell || ""; - @observable activeTab = PreferencesTab.Application; + @observable activeTab = Pages.Application; @computed get themeOptions(): SelectOption[] { return themeStore.themes.map(theme => ({ @@ -55,7 +55,7 @@ export class Preferences extends React.Component { ]); } - onTabChange = (tabId: PreferencesTab) => { + onTabChange = (tabId: Pages) => { this.activeTab = tabId; }; @@ -63,34 +63,14 @@ export class Preferences extends React.Component { const extensions = appPreferenceRegistry.getItems().filter(e => !e.showInPreferencesTab); return ( - +
Preferences
- - - - + + + + {extensions.length > 0 && - + }
); @@ -114,7 +94,7 @@ export class Preferences extends React.Component { render() { const { preferences } = userStore; const extensions = appPreferenceRegistry.getItems(); - const telemetryExtensions = extensions.filter(e => e.showInPreferencesTab == PreferencesTab.Telemetry); + const telemetryExtensions = extensions.filter(e => e.showInPreferencesTab == Pages.Telemetry); let defaultShell = process.env.SHELL || process.env.PTYSHELL; if (!defaultShell) { @@ -132,7 +112,7 @@ export class Preferences extends React.Component { className="Preferences" contentGaps={false} > - {this.activeTab == PreferencesTab.Application && ( + {this.activeTab == Pages.Application && (

Application

@@ -175,7 +155,7 @@ export class Preferences extends React.Component {
)} - {this.activeTab == PreferencesTab.Proxy && ( + {this.activeTab == Pages.Proxy && (

Proxy

@@ -215,7 +195,7 @@ export class Preferences extends React.Component {
)} - {this.activeTab == PreferencesTab.Kubernetes && ( + {this.activeTab == Pages.Kubernetes && (

Kubernetes

@@ -229,14 +209,14 @@ export class Preferences extends React.Component {
)} - {this.activeTab == PreferencesTab.Telemetry && ( + {this.activeTab == Pages.Telemetry && (

Telemetry

{telemetryExtensions.map(this.renderExtension)}
)} - {this.activeTab == PreferencesTab.Extensions && ( + {this.activeTab == Pages.Extensions && (

Extensions

{extensions.filter(e => !e.showInPreferencesTab).map(this.renderExtension)}