mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
cleanup Lens repo with tighter linting
Signed-off-by: Sebastian Malton <smalton@mirantis.com>
This commit is contained in:
1 parent
e468105143
commit
b1ff34879a
470 files changed
+8447
-7443
No files matched your search
@@ -1,5 +1,5 @@
|
||||
import './checkbox.scss'
|
||||
import React from 'react'
|
||||
import './checkbox.scss';
|
||||
import React from 'react';
|
||||
import { autobind, cssNames } from "../../utils";
|
||||
|
||||
interface Props<T = boolean> {
|
||||
@@ -16,18 +16,20 @@ export class Checkbox extends React.PureComponent<Props> {
|
||||
private input: HTMLInputElement;
|
||||
|
||||
@autobind()
|
||||
onChange(evt: React.ChangeEvent<HTMLInputElement>) {
|
||||
onChange(evt: React.ChangeEvent<HTMLInputElement>): void {
|
||||
if (this.props.onChange) {
|
||||
this.props.onChange(this.input.checked, evt)
|
||||
this.props.onChange(this.input.checked, evt);
|
||||
}
|
||||
}
|
||||
|
||||
getValue() {
|
||||
if (this.props.value !== undefined) return this.props.value;
|
||||
getValue(): boolean {
|
||||
if (this.props.value !== undefined) {
|
||||
return this.props.value;
|
||||
}
|
||||
return this.input.checked;
|
||||
}
|
||||
|
||||
render() {
|
||||
render(): JSX.Element {
|
||||
const { label, inline, className, value, theme, children, ...inputProps } = this.props;
|
||||
const componentClass = cssNames('Checkbox flex', className, {
|
||||
inline: inline,
|
||||
@@ -40,7 +42,9 @@ export class Checkbox extends React.PureComponent<Props> {
|
||||
<input
|
||||
{...inputProps}
|
||||
type="checkbox" checked={value} onChange={this.onChange}
|
||||
ref={e => this.input = e}
|
||||
ref={(e): void => {
|
||||
this.input = e;
|
||||
}}
|
||||
/>
|
||||
<i className="box flex align-center"/>
|
||||
{label ? <span className="label">{label}</span> : null}
|
||||
|
||||
@@ -1 +1 @@
|
||||
export * from './checkbox'
|
||||
export * from './checkbox';
|
||||
Reference in new issue
Block a user