Skip to content

Commit

Permalink
Merge pull request #265 from piyumaldk/pastel-on-header-avatar
Browse files Browse the repository at this point in the history
Add pastel color as bg to Header Avatar where image is not provided
  • Loading branch information
brionmario authored Oct 4, 2024
2 parents 0b8db8e + f460f20 commit 0f07b16
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/react/src/components/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,13 @@ const Header: FC<HeaderProps> & WithWrapperProps = (props: HeaderProps): ReactEl
color: 'inherit',
endIcon: <ChevronDownIcon />,
startIcon: (
<Avatar className="image" alt="User Image" src={user?.image}>
<Avatar
className="image"
alt="User Image"
src={user?.image}
randomBackgroundColor={!user?.image}
backgroundColorRandomizer={user?.name}
>
{user?.name?.split('')[0]}
</Avatar>
),
Expand Down

0 comments on commit 0f07b16

Please sign in to comment.