mirror of
https://github.com/lukevella/rallly.git
synced 2025-06-23 04:47:12 +02:00
🐛 Fix issue with external images (#1334)
This commit is contained in:
parent
cc38d5cb1f
commit
33385f9039
1 changed files with 13 additions and 9 deletions
|
@ -1,5 +1,5 @@
|
|||
"use client";
|
||||
import { Avatar, AvatarFallback } from "@rallly/ui/avatar";
|
||||
import { Avatar, AvatarFallback, AvatarImage } from "@rallly/ui/avatar";
|
||||
import Image from "next/image";
|
||||
|
||||
import { useUser } from "@/components/user-provider";
|
||||
|
@ -24,14 +24,18 @@ export const CurrentUserAvatar = ({
|
|||
return (
|
||||
<Avatar className={className} style={{ width: size, height: size }}>
|
||||
{user.image ? (
|
||||
<Image
|
||||
src={getAvatarUrl(user.image)}
|
||||
width={128}
|
||||
height={128}
|
||||
alt={user.name}
|
||||
style={{ objectFit: "cover" }}
|
||||
objectFit="cover"
|
||||
/>
|
||||
user.image.startsWith("http") ? (
|
||||
<AvatarImage src={user.image} />
|
||||
) : (
|
||||
<Image
|
||||
src={getAvatarUrl(user.image)}
|
||||
width={128}
|
||||
height={128}
|
||||
alt={user.name}
|
||||
style={{ objectFit: "cover" }}
|
||||
objectFit="cover"
|
||||
/>
|
||||
)
|
||||
) : (
|
||||
<AvatarFallback>{user.name[0]}</AvatarFallback>
|
||||
)}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue