Skip to content

Commit 6d24bef

Browse files
fix: add displayName for each component (#388)
1 parent 7dc2c48 commit 6d24bef

File tree

34 files changed

+123
-36
lines changed

34 files changed

+123
-36
lines changed

src/ActionBar/ActionBar.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export const ActionBar = ({ mobile, width, children, className, ...props }) => {
2020
</React.Fragment>
2121
);
2222
};
23+
ActionBar.displayName = 'ActionBar';
2324

2425
ActionBar.propTypes = {
2526
className: PropTypes.string,

src/Alert/Alert.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ export class Alert extends Component {
7070
);
7171
}
7272
}
73+
Alert.displayName = 'Alert';
7374

7475
Alert.propTypes = {
7576
buttonProps: PropTypes.object,

src/Badge/Badge.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export const Badge = ({ type, modifier, children, className, ...props }) => {
2020
</span>
2121
);
2222
};
23+
Badge.displayName = 'Badge';
2324

2425
Badge.propTypes = {
2526
className: PropTypes.string,
@@ -38,13 +39,14 @@ export const Label = ({ type, children, className, ...props }) => {
3839

3940
return <span {...props} className={labelClasses}>{children}</span>;
4041
};
42+
Label.displayName = 'Label';
4143

4244
Label.propTypes = {
4345
className: PropTypes.string,
4446
type: PropTypes.oneOf(LABEL_TYPES)
4547
};
4648

47-
export const Status = ({ type, glyph, children, className, ...props } ) => {
49+
export const Status = ({ type, glyph, children, className, ...props }) => {
4850
const statusClasses = classnames(
4951
'fd-status-label',
5052
{
@@ -62,6 +64,8 @@ export const Status = ({ type, glyph, children, className, ...props } ) => {
6264
</span>
6365
);
6466
};
67+
Status.displayName = 'Status';
68+
6569
Status.propTypes = {
6670
className: PropTypes.string,
6771
glyph: PropTypes.string,
@@ -84,6 +88,7 @@ export const Counter = ({ notification, children, className, ...props }) => {
8488
</span>
8589
);
8690
};
91+
Counter.displayName = 'Counter';
8792

8893
Counter.propTypes = {
8994
className: PropTypes.string,

src/Breadcrumb/Breadcrumb.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import React from 'react';
55
export const Breadcrumb = ({ children, ...props }) => {
66
return <ul {...props} className='fd-breadcrumb'>{children}</ul>;
77
};
8+
Breadcrumb.displayName = 'Breadcrumb';
89

910
Breadcrumb.propTypes = {
1011
children: PropTypes.node
@@ -38,6 +39,7 @@ export const BreadcrumbItem = ({ url, name, className, children, ...props }) =>
3839
</li>
3940
);
4041
};
42+
BreadcrumbItem.displayName = 'BreadcrumbItem';
4143

4244
BreadcrumbItem.propTypes = {
4345
name: PropTypes.string,

src/Button/Button.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ export const Button = ({
3939
{children}
4040
</button>);
4141
};
42+
Button.displayName = 'Button';
4243

4344
Button.propTypes = {
4445
children: PropTypes.node,
@@ -74,6 +75,7 @@ export const ButtonGroup = ({ children, ...props }) => {
7475
</div>
7576
);
7677
};
78+
ButtonGroup.displayName = 'ButtonGroup';
7779

7880
ButtonGroup.propTypes = {
7981
children: PropTypes.node

src/Calendar/Calendar.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,7 @@ export class Calendar extends Component {
547547
}
548548

549549
}
550+
Calendar.displayName = 'Calendar';
550551

551552
Calendar.basePropTypes = {
552553
blockedDates: PropTypes.arrayOf(PropTypes.instanceOf(Date)),

src/ComboboxInput/ComboboxInput.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ export const ComboboxInput = ({ placeholder, menu, compact, className, popoverPr
4949
</div>
5050
);
5151
};
52+
ComboboxInput.displayName = 'ComboboxInput';
5253

5354
ComboboxInput.propTypes = {
5455
menu: PropTypes.object.isRequired,

src/DatePicker/DatePicker.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,7 @@ export class DatePicker extends Component {
342342
);
343343
}
344344
}
345+
DatePicker.displayName = 'DatePicker';
345346

346347
DatePicker.propTypes = {
347348
...Calendar.basePropTypes,

src/Dropdown/Dropdown.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export const Dropdown = props => {
1919
</div>
2020
);
2121
};
22+
Dropdown.displayName = 'Dropdown';
2223

2324
Dropdown.propTypes = {
2425
children: PropTypes.node,

src/Forms/Forms.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ export const FormSet = ({ children, className, ...props }) => {
1616
</div>
1717
);
1818
};
19+
FormSet.displayName = 'FormSet';
20+
1921
FormSet.propTypes = {
2022
children: PropTypes.node,
2123
className: PropTypes.string
@@ -40,6 +42,7 @@ export const FormItem = ({ isCheck, isInline, children, className, ...props }) =
4042
</div>
4143
);
4244
};
45+
FormItem.displayName = 'FormItem';
4346

4447
FormItem.propTypes = {
4548
children: PropTypes.node,
@@ -69,6 +72,8 @@ export const FormLabel = ({ required, children, className, ...props }) => {
6972
</label>
7073
);
7174
};
75+
FormLabel.displayName = 'FormLabel';
76+
7277
FormLabel.propTypes = {
7378
children: PropTypes.node,
7479
className: PropTypes.string,
@@ -96,6 +101,8 @@ export const FormMessage = ({ type, children, className, ...props }) => {
96101
</span>
97102
);
98103
};
104+
FormMessage.displayName = 'FormMessage';
105+
99106
FormMessage.propTypes = {
100107
children: PropTypes.node,
101108
className: PropTypes.string,
@@ -118,6 +125,8 @@ export const FormInput = ({ state, className, ...props }) => {
118125
className={formInputClasses} />
119126
);
120127
};
128+
FormInput.displayName = 'FormInput';
129+
121130
FormInput.propTypes = {
122131
className: PropTypes.string,
123132
state: PropTypes.string
@@ -142,6 +151,8 @@ export const FormTextarea = ({ children, className, ...props }) => {
142151
</textarea>
143152
);
144153
};
154+
FormTextarea.displayName = 'FormTextarea';
155+
145156
FormTextarea.propTypes = {
146157
children: PropTypes.node,
147158
className: PropTypes.string
@@ -162,6 +173,8 @@ export const FormFieldset = ({ children, className, ...props }) => {
162173
</fieldset>
163174
);
164175
};
176+
FormFieldset.displayName = 'FormFieldset';
177+
165178
FormFieldset.propTypes = {
166179
children: PropTypes.node,
167180
className: PropTypes.string
@@ -182,6 +195,8 @@ export const FormLegend = ({ children, className, ...props }) => {
182195
</legend>
183196
);
184197
};
198+
FormLegend.displayName = 'FormLegend';
199+
185200
FormLegend.propTypes = {
186201
children: PropTypes.node,
187202
className: PropTypes.string
@@ -203,6 +218,8 @@ export const FormSelect = ({ disabled, children, className, ...props }) => {
203218
</select>
204219
);
205220
};
221+
FormSelect.displayName = 'FormSelect';
222+
206223
FormSelect.propTypes = {
207224
children: PropTypes.node,
208225
className: PropTypes.string,
@@ -269,6 +286,8 @@ export class FormRadio extends Component {
269286
return <div>{result}</div>;
270287
}
271288
}
289+
FormRadio.displayName = 'FormRadio';
290+
272291
FormRadio.propTypes = {
273292
inputs: PropTypes.array.isRequired,
274293
defaultChecked: PropTypes.string,

0 commit comments

Comments
 (0)