Fix use transparent bg if Avatar contains <img/> inside (#5131)

This commit is contained in:
Alex Andreev authored and GitHub committed 2022-03-29 10:02:18 -04:00
1 parent 13632e8380
commit dd0cb8594c
2 files changed
+7 -2

No files matched your search

@@ -59,6 +59,10 @@ export function Avatar(props: AvatarProps) {
const { title, variant = "rounded", size = 32, colorHash, children, background, imgProps, src, className, disabled, ...rest } = props;
const getBackgroundColor = () => {
if (src) {
return "transparent";
}
return background || randomColor({ seed: colorHash, luminosity: "dark" });
};