mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Remove HotbarIcon box-shadow artifacts (#5142)
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
1 parent
69f1ecb0b9
commit
37d8294198
3 files changed
+13
-11
No files matched your search
@@ -57,14 +57,7 @@ function getLabelFromTitle(title: string) {
|
||||
|
||||
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" });
|
||||
};
|
||||
const colorFromHash = randomColor({ seed: colorHash, luminosity: "dark" });
|
||||
|
||||
const renderContents = () => {
|
||||
if (src) {
|
||||
@@ -81,7 +74,11 @@ export function Avatar(props: AvatarProps) {
|
||||
[styles.rounded]: variant == "rounded",
|
||||
[styles.disabled]: disabled,
|
||||
}, className)}
|
||||
style={{ width: `${size}px`, height: `${size}px`, backgroundColor: getBackgroundColor() }}
|
||||
style={{
|
||||
width: `${size}px`,
|
||||
height: `${size}px`,
|
||||
background: background || (src ? "transparent" : colorFromHash),
|
||||
}}
|
||||
{...rest}
|
||||
>
|
||||
{renderContents()}
|
||||
|
||||
Reference in new issue
Block a user