Skip to content

Commit 5172006

Browse files
committed
Fix lint
1 parent ab2e8e5 commit 5172006

File tree

4 files changed

+11
-33
lines changed

4 files changed

+11
-33
lines changed

src/components/ui/Radio.tsx

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,12 @@ import Error from './error';
88
type Props = {
99
field: FieldInterface;
1010
className: string;
11-
focus: boolean;
12-
showLabel: boolean;
11+
focus?: boolean;
12+
showLabel?: boolean;
1313
};
1414

1515
// TODO: Should this file be converted into the coding style similar to './toggle/index.tsx'?
1616
class Radio extends Component<Props> {
17-
static defaultProps = {
18-
focus: false,
19-
showLabel: true,
20-
};
21-
2217
inputElement = null;
2318

2419
componentDidMount() {
@@ -33,7 +28,7 @@ class Radio extends Component<Props> {
3328
}
3429

3530
render() {
36-
const { field, className, showLabel } = this.props;
31+
const { field, className, showLabel = true } = this.props;
3732

3833
return (
3934
<div

src/components/ui/badge/index.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,8 @@ interface IProps extends WithStylesProps<typeof styles> {
4545
}
4646

4747
class BadgeComponent extends Component<IProps> {
48-
public static defaultProps = {
49-
type: 'primary',
50-
};
51-
5248
render() {
53-
const { classes, children, type, className } = this.props;
49+
const { classes, children, type = 'primary', className } = this.props;
5450

5551
return (
5652
<div

src/components/ui/label/index.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,10 @@ interface ILabel
1414
}
1515

1616
class LabelComponent extends Component<ILabel> {
17-
static defaultProps = {
18-
showLabel: true,
19-
};
20-
2117
render() {
2218
const {
2319
title,
24-
showLabel,
20+
showLabel = true,
2521
classes,
2622
className,
2723
children,

src/components/ui/textarea/index.tsx

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,6 @@ interface IProps
2525
}
2626

2727
class TextareaComponent extends Component<IProps> {
28-
static defaultProps = {
29-
onChange: noop,
30-
onBlur: noop,
31-
onFocus: noop,
32-
showLabel: true,
33-
disabled: false,
34-
rows: 5,
35-
};
36-
3728
private textareaRef = createRef<HTMLTextAreaElement>();
3829

3930
componentDidMount() {
@@ -47,7 +38,7 @@ class TextareaComponent extends Component<IProps> {
4738
}
4839

4940
onChange(e: React.ChangeEvent<HTMLTextAreaElement>) {
50-
const { onChange } = this.props;
41+
const { onChange = noop } = this.props;
5142

5243
if (onChange) {
5344
onChange(e);
@@ -58,22 +49,22 @@ class TextareaComponent extends Component<IProps> {
5849
const {
5950
classes,
6051
className,
61-
disabled,
52+
disabled = false,
6253
error,
6354
id,
6455
textareaClassName,
6556
label,
66-
showLabel,
57+
showLabel = true,
6758
value,
6859
name,
6960
placeholder,
7061
spellCheck,
71-
onBlur,
72-
onFocus,
62+
onBlur = noop,
63+
onFocus = noop,
7364
minLength,
7465
maxLength,
7566
required,
76-
rows,
67+
rows = 5,
7768
noMargin,
7869
} = this.props;
7970

0 commit comments

Comments
 (0)