mirror of
https://github.com/ershisan99/www.git
synced 2025-12-17 12:34:17 +00:00
fix avatars
This commit is contained in:
@@ -28,12 +28,15 @@ function AvatarImage({
|
|||||||
...props
|
...props
|
||||||
}: React.ComponentProps<typeof AvatarPrimitive.Image>) {
|
}: React.ComponentProps<typeof AvatarPrimitive.Image>) {
|
||||||
const isDev = process.env.NODE_ENV === 'development'
|
const isDev = process.env.NODE_ENV === 'development'
|
||||||
|
let finalSrc = src
|
||||||
|
if (src?.startsWith('/') && !isDev) {
|
||||||
|
finalSrc = `${CDN_URL}${src}`
|
||||||
|
}
|
||||||
return (
|
return (
|
||||||
<AvatarPrimitive.Image
|
<AvatarPrimitive.Image
|
||||||
data-slot='avatar-image'
|
data-slot='avatar-image'
|
||||||
className={cn('aspect-square size-full object-cover!', className)}
|
className={cn('aspect-square size-full object-cover!', className)}
|
||||||
src={isDev ? src : `${CDN_URL}${src}`}
|
src={finalSrc}
|
||||||
{...props}
|
{...props}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user