Skip to content

Commit

Permalink
Support avatars with no src and no name (#95)
Browse files Browse the repository at this point in the history
  • Loading branch information
jscheel authored Aug 24, 2020
1 parent 2ec8be5 commit 098527b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/Avatar.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ export const Avatar = ({
a11yProps['aria-label'] = 'Loading avatar ...'
} else if (src) {
avatarFigure = <img src={src} alt={name} />
} else {
} else if (name) {
avatarFigure = (
<img
src={generateAvatarUrl({ background, color, name, size })}
Expand Down
1 change: 1 addition & 0 deletions src/components/Avatar.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export const autoAvatar = () => (
<Avatar size="big" name="Tair Assimov" />
<Avatar size="medium" name="Jared Scheel" />
<Avatar size="small" name="Kevin Rademan" />
<Avatar size="big" />
</Background>
)

Expand Down

0 comments on commit 098527b

Please sign in to comment.