about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/view/com/util/UserAvatar.tsx19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/view/com/util/UserAvatar.tsx b/src/view/com/util/UserAvatar.tsx
index 3a7dcca3d..97cd831b3 100644
--- a/src/view/com/util/UserAvatar.tsx
+++ b/src/view/com/util/UserAvatar.tsx
@@ -98,6 +98,13 @@ let DefaultAvatar = ({
   size: number
 }): React.ReactNode => {
   const finalShape = overrideShape ?? (type === 'user' ? 'circle' : 'square')
+
+  const aviStyle = useMemo(() => {
+    if (finalShape === 'square') {
+      return {borderRadius: size > 32 ? 8 : 3, overflow: 'hidden'} as const
+    }
+  }, [finalShape, size])
+
   if (type === 'algo') {
     // TODO: shape=circle
     // Font Awesome Pro 6.4.0 by @fontawesome -https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc.
@@ -108,7 +115,8 @@ let DefaultAvatar = ({
         height={size}
         viewBox="0 0 32 32"
         fill="none"
-        stroke="none">
+        stroke="none"
+        style={aviStyle}>
         <Rect width="32" height="32" rx="4" fill="#0070FF" />
         <Path
           d="M13.5 7.25C13.5 6.55859 14.0586 6 14.75 6C20.9648 6 26 11.0352 26 17.25C26 17.9414 25.4414 18.5 24.75 18.5C24.0586 18.5 23.5 17.9414 23.5 17.25C23.5 12.418 19.582 8.5 14.75 8.5C14.0586 8.5 13.5 7.94141 13.5 7.25ZM8.36719 14.6172L12.4336 18.6836L13.543 17.5742C13.5156 17.4727 13.5 17.3633 13.5 17.25C13.5 16.5586 14.0586 16 14.75 16C15.4414 16 16 16.5586 16 17.25C16 17.9414 15.4414 18.5 14.75 18.5C14.6367 18.5 14.5312 18.4844 14.4258 18.457L13.3164 19.5664L17.3828 23.6328C17.9492 24.1992 17.8438 25.1484 17.0977 25.4414C16.1758 25.8008 15.1758 26 14.125 26C9.63672 26 6 22.3633 6 17.875C6 16.8242 6.19922 15.8242 6.5625 14.9023C6.85547 14.1602 7.80469 14.0508 8.37109 14.6172H8.36719ZM14.75 9.75C18.8906 9.75 22.25 13.1094 22.25 17.25C22.25 17.9414 21.6914 18.5 21 18.5C20.3086 18.5 19.75 17.9414 19.75 17.25C19.75 14.4883 17.5117 12.25 14.75 12.25C14.0586 12.25 13.5 11.6914 13.5 11C13.5 10.3086 14.0586 9.75 14.75 9.75Z"
@@ -127,7 +135,8 @@ let DefaultAvatar = ({
         height={size}
         viewBox="0 0 32 32"
         fill="none"
-        stroke="none">
+        stroke="none"
+        style={aviStyle}>
         <Path
           d="M28 0H4C1.79086 0 0 1.79086 0 4V28C0 30.2091 1.79086 32 4 32H28C30.2091 32 32 30.2091 32 28V4C32 1.79086 30.2091 0 28 0Z"
           fill="#0070FF"
@@ -151,7 +160,8 @@ let DefaultAvatar = ({
         height={size}
         viewBox="0 0 32 32"
         fill="none"
-        stroke="none">
+        stroke="none"
+        style={aviStyle}>
         {finalShape === 'square' ? (
           <Rect
             x="0"
@@ -182,7 +192,8 @@ let DefaultAvatar = ({
       height={size}
       viewBox="0 0 24 24"
       fill="none"
-      stroke="none">
+      stroke="none"
+      style={aviStyle}>
       <Circle cx="12" cy="12" r="12" fill="#0070ff" />
       <Circle cx="12" cy="9.5" r="3.5" fill="#fff" />
       <Path