Skip to content

Commit

Permalink
feat(react): add pastel color as bg to Header Avatar where image is n…
Browse files Browse the repository at this point in the history
…ot provided
  • Loading branch information
piyumaldk committed Oct 4, 2024
1 parent 0b8db8e commit f460f20
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 f460f20

Please sign in to comment.