Skip to content

Commit

Permalink
Remove defaultProps
Browse files Browse the repository at this point in the history
  • Loading branch information
josepmartins committed Sep 16, 2024
1 parent 5eb6cec commit a2dcee3
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions src/lib/components/avatar.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,15 @@ const DEPRECATED_VARIANTS = {
abstract: 'bauhaus',
};

const Avatar = (props) => {
const { variant = 'marble', colors, name, title, size, square, ...otherProps } = props;

const Avatar = ({
variant = 'marble',
colors = ['#92A1C6', '#146A7C', '#F0AB3D', '#C271B4', '#C20D90'],
name = 'Clara Barton',
title = false,
size,
square = false,
...otherProps
}) => {
const resolvedVariant = DEPRECATED_VARIANTS[variant] || variant;
const AvatarComponent = AVATAR_VARIANTS[resolvedVariant] || AvatarMarble;

Expand All @@ -47,12 +53,4 @@ Avatar.propTypes = {
title: PropTypes.bool,
};

Avatar.defaultProps = {
variant: 'marble',
colors: ['#92A1C6', '#146A7C', '#F0AB3D', '#C271B4', '#C20D90'],
name: 'Clara Barton',
square: false,
title: false,
};

export default Avatar;

0 comments on commit a2dcee3

Please sign in to comment.