diff --git a/src/renderer/components/+preferences/preferences.tsx b/src/renderer/components/+preferences/preferences.tsx
index 8159445c19..3a1664b23f 100644
--- a/src/renderer/components/+preferences/preferences.tsx
+++ b/src/renderer/components/+preferences/preferences.tsx
@@ -17,6 +17,7 @@ import { HelmCharts } from "./helm-charts";
import { KubectlBinaries } from "./kubectl-binaries";
import { navigation } from "../../navigation";
import { Tab, Tabs } from "../tabs";
+import { FormSwitch, Switcher } from "../switch";
enum PreferencesTab {
Application = "application",
@@ -137,11 +138,15 @@ export class Preferences extends React.Component {
Start-up
-
- preferences.openAtLogin = v.target.checked}
+ name="startup"
+ />
+ }
label="Automatically start Lens on login"
- value={preferences.openAtLogin}
- onChange={v => preferences.openAtLogin = v}
/>
diff --git a/src/renderer/components/layout/page-layout.scss b/src/renderer/components/layout/page-layout.scss
index e9eb61e471..ef7aca9824 100644
--- a/src/renderer/components/layout/page-layout.scss
+++ b/src/renderer/components/layout/page-layout.scss
@@ -133,6 +133,7 @@
font-weight: 600;
font-size: 14px;
color: var(--textColorDimmed);
+ pointer-events: none;
}
}
}
diff --git a/src/renderer/components/switch/form-switcher.tsx b/src/renderer/components/switch/form-switcher.tsx
new file mode 100644
index 0000000000..02441942a8
--- /dev/null
+++ b/src/renderer/components/switch/form-switcher.tsx
@@ -0,0 +1,28 @@
+import React from "react";
+import FormControlLabel, { FormControlLabelProps } from "@material-ui/core/FormControlLabel";
+import { makeStyles } from "@material-ui/styles";
+
+const useStyles = makeStyles({
+ root: {
+ margin: 0,
+ "& .MuiTypography-root": {
+ fontSize: 14,
+ fontWeight: 500,
+ flex: 1,
+ color: "var(--textColorAccent)"
+ }
+ },
+});
+
+export function FormSwitch(props: FormControlLabelProps) {
+ const classes = useStyles();
+
+ return (
+
+ );
+}
diff --git a/src/renderer/components/switch/index.ts b/src/renderer/components/switch/index.ts
new file mode 100644
index 0000000000..55420a10da
--- /dev/null
+++ b/src/renderer/components/switch/index.ts
@@ -0,0 +1,2 @@
+export * from "./switcher";
+export * from "./form-switcher";
diff --git a/src/renderer/components/switch/switcher.tsx b/src/renderer/components/switch/switcher.tsx
new file mode 100644
index 0000000000..6eff1319ce
--- /dev/null
+++ b/src/renderer/components/switch/switcher.tsx
@@ -0,0 +1,68 @@
+import React from "react";
+import { createStyles, withStyles, Theme } from "@material-ui/core/styles";
+import Switch, { SwitchClassKey, SwitchProps } from "@material-ui/core/Switch";
+
+interface Styles extends Partial> {
+ focusVisible?: string;
+}
+
+interface Props extends SwitchProps {
+ classes: Styles;
+}
+
+export const Switcher = withStyles((theme: Theme) =>
+ createStyles({
+ root: {
+ width: 40,
+ height: 24,
+ padding: 0,
+ margin: "0 0 0 8px",
+ },
+ switchBase: {
+ padding: 1,
+ paddingLeft: 4,
+ "&$checked": {
+ transform: "translateX(14px)",
+ color: "white",
+ "& + $track": {
+ backgroundColor: "#52d869",
+ opacity: 1,
+ border: "none",
+ },
+ },
+ "&$focusVisible $thumb": {
+ color: "#52d869",
+ border: "6px solid #fff",
+ },
+ },
+ thumb: {
+ width: 18,
+ height: 18,
+ marginTop: 2,
+ boxShadow: "none"
+ },
+ track: {
+ borderRadius: 26 / 2,
+ backgroundColor: "#72767b",
+ opacity: 1,
+ transition: theme.transitions.create(["background-color", "border"]),
+ },
+ checked: {},
+ focusVisible: {},
+ }),
+)(({ classes, ...props }: Props) => {
+ return (
+
+ );
+});