mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Enforce some naming conventions (#4813)
This commit is contained in:
1 parent
dc6615f98f
commit
0b32775d40
197 files changed
+630
-634
No files matched your search
@@ -8,11 +8,11 @@ import styles from "./switch.module.scss";
|
||||
import React, { ChangeEvent, HTMLProps } from "react";
|
||||
import { cssNames } from "../../utils";
|
||||
|
||||
interface Props extends Omit<HTMLProps<HTMLInputElement>, "onChange"> {
|
||||
export interface SwitchProps extends Omit<HTMLProps<HTMLInputElement>, "onChange"> {
|
||||
onChange?: (checked: boolean, event: ChangeEvent<HTMLInputElement>) => void;
|
||||
}
|
||||
|
||||
export function Switch({ children, disabled, onChange, ...props }: Props) {
|
||||
export function Switch({ children, disabled, onChange, ...props }: SwitchProps) {
|
||||
return (
|
||||
<label className={cssNames(styles.Switch, { [styles.disabled]: disabled })} data-testid="switch">
|
||||
{children}
|
||||
|
||||
@@ -11,7 +11,7 @@ interface Styles extends Partial<Record<SwitchClassKey, string>> {
|
||||
focusVisible?: string;
|
||||
}
|
||||
|
||||
interface Props extends SwitchProps {
|
||||
export interface SwitcherProps extends SwitchProps {
|
||||
classes: Styles;
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ export const Switcher = withStyles((theme: Theme) =>
|
||||
checked: {},
|
||||
focusVisible: {},
|
||||
}),
|
||||
)(({ classes, ...props }: Props) => {
|
||||
)(({ classes, ...props }: SwitcherProps) => {
|
||||
return (
|
||||
<Switch
|
||||
focusVisibleClassName={classes.focusVisible}
|
||||
|
||||
Reference in new issue
Block a user