{createElement(
@@ -68,30 +86,34 @@ export const Avatar: FC<
}
: {}),
},
- imageUrl ? (
+ imageUrl && !loadError ? (
setLoaded(true)}
+ onError={() => setLoadError(true)}
loading={lazy ? 'lazy' : 'eager'}
{...imageProps}
className={clsxm(
- 'aspect-square rounded-full',
+ 'aspect-square rounded-full duration-200',
imageProps.className,
)}
/>
) : text ? (
-
-
+
+
) : null,
)}
diff --git a/src/components/ui/tag/Tag.tsx b/src/components/ui/tag/Tag.tsx
index 7d9f444b06..50c499e5ec 100644
--- a/src/components/ui/tag/Tag.tsx
+++ b/src/components/ui/tag/Tag.tsx
@@ -1,4 +1,4 @@
-import { memo } from 'react'
+import { memo, useMemo } from 'react'
import { useIsDark } from '~/hooks/common/use-is-dark'
import { addAlphaToHSL, getColorScheme, stringToHue } from '~/lib/color'
@@ -12,7 +12,10 @@ export const Tag = memo(function Tag
(props: {
count?: number
}) {
const { text, count, passProps, onClick } = props
- const { dark, light } = getColorScheme(stringToHue(text))
+ const { dark, light } = useMemo(
+ () => getColorScheme(stringToHue(text)),
+ [text],
+ )
const isDark = useIsDark()
const bgColor = isDark ? dark.background : light.background