mirror of
https://github.com/lukevella/rallly.git
synced 2025-06-23 21:07:10 +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";
|
"use client";
|
||||||
import { Avatar, AvatarFallback } from "@rallly/ui/avatar";
|
import { Avatar, AvatarFallback, AvatarImage } from "@rallly/ui/avatar";
|
||||||
import Image from "next/image";
|
import Image from "next/image";
|
||||||
|
|
||||||
import { useUser } from "@/components/user-provider";
|
import { useUser } from "@/components/user-provider";
|
||||||
|
@ -24,14 +24,18 @@ export const CurrentUserAvatar = ({
|
||||||
return (
|
return (
|
||||||
<Avatar className={className} style={{ width: size, height: size }}>
|
<Avatar className={className} style={{ width: size, height: size }}>
|
||||||
{user.image ? (
|
{user.image ? (
|
||||||
<Image
|
user.image.startsWith("http") ? (
|
||||||
src={getAvatarUrl(user.image)}
|
<AvatarImage src={user.image} />
|
||||||
width={128}
|
) : (
|
||||||
height={128}
|
<Image
|
||||||
alt={user.name}
|
src={getAvatarUrl(user.image)}
|
||||||
style={{ objectFit: "cover" }}
|
width={128}
|
||||||
objectFit="cover"
|
height={128}
|
||||||
/>
|
alt={user.name}
|
||||||
|
style={{ objectFit: "cover" }}
|
||||||
|
objectFit="cover"
|
||||||
|
/>
|
||||||
|
)
|
||||||
) : (
|
) : (
|
||||||
<AvatarFallback>{user.name[0]}</AvatarFallback>
|
<AvatarFallback>{user.name[0]}</AvatarFallback>
|
||||||
)}
|
)}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue