mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-11-24 13:37:34 +03:00
Base avatar bg color on srcUrl instead of tooltip (#4903)
* Base avatar bg color on srcUrl instead of tooltip - consistent per author --------- Co-authored-by: Pavel Laptev <pawellaptew@gmail.com>
This commit is contained in:
parent
1a47f5ec4d
commit
ba360d2e85
@ -16,7 +16,7 @@
|
||||
</script>
|
||||
|
||||
<Tooltip text={tooltip} align={tooltipAlign} position={tooltipPosition}>
|
||||
<div class="image-wrapper {size}" style:background-color={stringToColor(tooltip)}>
|
||||
<div class="image-wrapper {size}" style:background-color={stringToColor(srcUrl)}>
|
||||
<img
|
||||
class="avatar"
|
||||
alt={tooltip}
|
||||
|
@ -18,5 +18,6 @@ export function stringToColor(name: string | undefined) {
|
||||
}
|
||||
|
||||
const startHash = trimmed.split('').reduce((acc, char) => acc + char.charCodeAt(0), 0);
|
||||
|
||||
return colors[startHash % colors.length];
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user