diff options
Diffstat (limited to 'extension/src/components/BMIcon.tsx')
-rw-r--r-- | extension/src/components/BMIcon.tsx | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/extension/src/components/BMIcon.tsx b/extension/src/components/BMIcon.tsx index d8622fb..5e2f9c9 100644 --- a/extension/src/components/BMIcon.tsx +++ b/extension/src/components/BMIcon.tsx @@ -20,6 +20,12 @@ function BMIcon(props: {imgSrc?: string, bmUrl?:string}) { setIconMode("letter"); } + if (!props.imgSrc) { + let url = new URL(props.bmUrl!); + bgColor = hashStringToColor(url.hostname) + iconMode = "letter" + } + return ( <div className={"icon-box " + (iconMode)} style={bgColor ? {"--icon-bg": `rgba(${bgColor[0]}, ${bgColor[1]}, ${bgColor[2]}, 0.2)`} as React.CSSProperties : undefined}> |