fix image fallback bug

This commit is contained in:
Ren Amamiya
2023-06-22 17:36:12 +07:00
parent a71e2991c2
commit 36888221ff
28 changed files with 151 additions and 52 deletions

View File

@@ -13,6 +13,7 @@ export function Kind1063({ metadata }: { metadata: NDKTag[] }) {
{isImage(url) && (
<Image
src={url}
fallback="https://void.cat/d/XTmrMkpid8DGLjv1AzdvcW"
alt="image"
className="h-auto w-full rounded-lg object-cover"
/>

View File

@@ -8,6 +8,7 @@ export function ImagePreview({ urls }: { urls: string[] }) {
<div key={url} className="min-w-0 grow-0 shrink-0 basis-full">
<Image
src={url}
fallback="https://void.cat/d/XTmrMkpid8DGLjv1AzdvcW"
alt="image"
className="h-auto w-full rounded-lg object-cover"
/>

View File

@@ -27,9 +27,9 @@ export function LinkPreview({ urls }: { urls: string[] }) {
{data["og:image"] && (
<Image
src={data["og:image"]}
fallback="https://void.cat/d/XTmrMkpid8DGLjv1AzdvcW"
alt={urls[0]}
className="w-full h-44 object-cover rounded-t-lg bg-white"
fallback="https://void.cat/d/XTmrMkpid8DGLjv1AzdvcW"
/>
)}
<div className="flex flex-col gap-2 px-3 py-3">

View File

@@ -50,7 +50,8 @@ export function NoteReplyForm({ id }: { id: string }) {
<div className="inline-flex items-center gap-2">
<div className="relative h-9 w-9 shrink-0 rounded">
<Image
src={user?.image || DEFAULT_AVATAR}
src={user?.image}
fallback={DEFAULT_AVATAR}
alt={account.npub}
className="h-9 w-9 rounded-md bg-white object-cover"
/>

View File

@@ -19,7 +19,7 @@ export function Repost({
const kind1063 = data?.kind === 1063 ? data.tags : null;
return (
<div className="relative overflow-hidden flex flex-col mt-12 pb-6">
<div className="relative overflow-hidden flex flex-col mt-12">
{data ? (
<>
<User pubkey={data.pubkey} time={data.created_at} />