mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Fix use transparent bg if Avatar contains <img/> inside (#5131)
This commit is contained in:
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" });
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user