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

Clean up material UI (except types) from FormSwitch

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
Alex Andreev 2022-08-18 16:55:00 +03:00
parent 04d89c970d
commit 8d9c474396

View File

@ -5,28 +5,11 @@
import React from "react";
import type { FormControlLabelProps } from "@material-ui/core/FormControlLabel";
import FormControlLabel from "@material-ui/core/FormControlLabel";
import { makeStyles } from "@material-ui/styles";
import { Switch } from "./switch";
const useStyles = makeStyles({
root: {
margin: 0,
"& .MuiTypography-root": {
fontSize: 14,
fontWeight: 500,
flex: 1,
color: "var(--textColorAccent)",
},
},
});
/**
* @deprecated Use <Switch/> instead from "../switch.tsx".
*/
export function FormSwitch(props: FormControlLabelProps & { children?: React.ReactNode }) {
const classes = useStyles();
const ClonedElement = React.cloneElement(props.control, {
children: props.label,
});