Skip to content

Commit a2dcee3

Browse files
committed
Remove defaultProps
1 parent 5eb6cec commit a2dcee3

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

src/lib/components/avatar.js

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,15 @@ const DEPRECATED_VARIANTS = {
2121
abstract: 'bauhaus',
2222
};
2323

24-
const Avatar = (props) => {
25-
const { variant = 'marble', colors, name, title, size, square, ...otherProps } = props;
26-
24+
const Avatar = ({
25+
variant = 'marble',
26+
colors = ['#92A1C6', '#146A7C', '#F0AB3D', '#C271B4', '#C20D90'],
27+
name = 'Clara Barton',
28+
title = false,
29+
size,
30+
square = false,
31+
...otherProps
32+
}) => {
2733
const resolvedVariant = DEPRECATED_VARIANTS[variant] || variant;
2834
const AvatarComponent = AVATAR_VARIANTS[resolvedVariant] || AvatarMarble;
2935

@@ -47,12 +53,4 @@ Avatar.propTypes = {
4753
title: PropTypes.bool,
4854
};
4955

50-
Avatar.defaultProps = {
51-
variant: 'marble',
52-
colors: ['#92A1C6', '#146A7C', '#F0AB3D', '#C271B4', '#C20D90'],
53-
name: 'Clara Barton',
54-
square: false,
55-
title: false,
56-
};
57-
5856
export default Avatar;

0 commit comments

Comments
 (0)