1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Using native switch in places

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
Alex Andreev 2021-12-27 11:44:23 +03:00
parent 84c2f83ff3
commit a4b277ad64
4 changed files with 16 additions and 53 deletions

View File

@ -27,7 +27,7 @@ import { ThemeStore } from "../../theme.store";
import { UserStore } from "../../../common/user-store";
import { Input } from "../input";
import { isWindows } from "../../../common/vars";
import { FormSwitch, Switch, Switcher } from "../switch";
import { Switch } from "../switch";
import moment from "moment-timezone";
import { CONSTANTS, defaultExtensionRegistryUrl, ExtensionRegistryLocation } from "../../../common/user-store/preferences-helpers";
import { action } from "mobx";
@ -86,16 +86,9 @@ export const Application = observer(() => {
<section id="terminalSelection">
<SubTitle title="Terminal copy & paste" />
<FormSwitch
label="Copy on select and paste on right-click"
control={
<Switcher
checked={userStore.terminalCopyOnSelect}
onChange={v => userStore.terminalCopyOnSelect = v.target.checked}
name="terminalCopyOnSelect"
/>
}
/>
<Switch checked={userStore.terminalCopyOnSelect} onChange={v => userStore.terminalCopyOnSelect = v.target.checked}>
Copy on select and paste on right-click
</Switch>
</section>
<hr/>
@ -138,16 +131,6 @@ export const Application = observer(() => {
<Switch checked={userStore.openAtLogin} onChange={v => userStore.openAtLogin = v.target.checked}>
Automatically start Lens on login
</Switch>
{/* <FormSwitch
control={
<Switcher
checked={userStore.openAtLogin}
onChange={v => userStore.openAtLogin = v.target.checked}
name="startup"
/>
}
label="Automatically start Lens on login"
/> */}
</section>
<hr />

View File

@ -21,7 +21,7 @@
import { observer } from "mobx-react";
import React from "react";
import { UserStore } from "../../../common/user-store";
import { FormSwitch, Switcher } from "../switch";
import { Switch } from "../switch";
import { Select } from "../select";
import { SubTitle } from "../layout/sub-title";
import { SubHeader } from "../layout/sub-header";
@ -45,15 +45,9 @@ export const Editor = observer(() => {
<section>
<div className="flex gaps justify-space-between">
<div className="flex gaps align-center">
<FormSwitch
label={<SubHeader compact>Show minimap</SubHeader>}
control={
<Switcher
checked={editorConfiguration.minimap.enabled}
onChange={(evt, checked) => editorConfiguration.minimap.enabled = checked}
/>
}
/>
<Switch checked={editorConfiguration.minimap.enabled} onChange={v => editorConfiguration.minimap.enabled = v.target.checked}>
Copy on select and paste on right-click
</Switch>
</div>
<div className="flex gaps align-center">
<SubHeader compact>Position</SubHeader>

View File

@ -26,7 +26,7 @@ import { getDefaultKubectlDownloadPath, UserStore } from "../../../common/user-s
import { observer } from "mobx-react";
import { bundledKubectlPath } from "../../../main/kubectl";
import { SelectOption, Select } from "../select";
import { FormSwitch, Switcher } from "../switch";
import { Switch } from "../switch";
import { packageMirrors } from "../../../common/user-store/preferences-helpers";
export const KubectlBinaries = observer(() => {
@ -48,16 +48,9 @@ export const KubectlBinaries = observer(() => {
<>
<section>
<SubTitle title="Kubectl binary download"/>
<FormSwitch
control={
<Switcher
checked={userStore.downloadKubectlBinaries}
onChange={v => userStore.downloadKubectlBinaries = v.target.checked}
name="kubectl-download"
/>
}
label="Download kubectl binaries matching the Kubernetes cluster version"
/>
<Switch checked={userStore.downloadKubectlBinaries} onChange={v => userStore.downloadKubectlBinaries = v.target.checked}>
Download kubectl binaries matching the Kubernetes cluster version
</Switch>
</section>
<section>

View File

@ -24,7 +24,7 @@ import React from "react";
import { UserStore } from "../../../common/user-store";
import { Input } from "../input";
import { SubTitle } from "../layout/sub-title";
import { FormSwitch, Switcher } from "../switch";
import { Switch } from "../switch";
export const LensProxy = observer(() => {
const [proxy, setProxy] = React.useState(UserStore.getInstance().httpsProxy || "");
@ -50,16 +50,9 @@ export const LensProxy = observer(() => {
<section className="small">
<SubTitle title="Certificate Trust"/>
<FormSwitch
control={
<Switcher
checked={UserStore.getInstance().allowUntrustedCAs}
onChange={v => UserStore.getInstance().allowUntrustedCAs = v.target.checked}
name="startup"
/>
}
label="Allow untrusted Certificate Authorities"
/>
<Switch checked={UserStore.getInstance().allowUntrustedCAs} onChange={v => UserStore.getInstance().allowUntrustedCAs = v.target.checked}>
Allow untrusted Certificate Authorities
</Switch>
<small className="hint">
This will make Lens to trust ANY certificate authority without any validations.{" "}
Needed with some corporate proxies that do certificate re-writing.{" "}