From 50cfc8e77ea4adbc1a7fa15b425f0e4b9b5285e5 Mon Sep 17 00:00:00 2001 From: Jared Pereira Date: Wed, 20 May 2026 14:40:02 -0400 Subject: [PATCH] pass down cover image from standard site post item --- .../StandardSitePostItem.tsx | 31 +++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/components/Blocks/StandardSitePostBlock/StandardSitePostItem.tsx b/components/Blocks/StandardSitePostBlock/StandardSitePostItem.tsx index f199dd62..8e6f5863 100644 --- a/components/Blocks/StandardSitePostBlock/StandardSitePostItem.tsx +++ b/components/Blocks/StandardSitePostBlock/StandardSitePostItem.tsx @@ -1,4 +1,5 @@ "use client"; +import { AtUri } from "@atproto/api"; import { PublicationPostItemSmall, PublicationPostItemMedium, @@ -7,6 +8,7 @@ import { import { LocalizedDate } from "app/lish/[did]/[publication]/LocalizedDate"; import { getDocumentURL } from "app/lish/createPub/getPublicationURL"; import { getFirstParagraph } from "src/utils/getFirstParagraph"; +import { blobRefToSrc } from "src/utils/blobRefToSrc"; import { useStandardSitePost } from "components/StandardSitePostDataProvider"; import type { StandardSitePostData } from "app/api/rpc/[command]/get_standard_site_posts"; @@ -69,6 +71,17 @@ export function StandardSitePostItemView({ ) : undefined; const description = post.record.description || getFirstParagraph(post.record); + let postDid: string | undefined; + try { + postDid = new AtUri(post.uri).host; + } catch { + postDid = undefined; + } + const coverImageSrc = + post.record.coverImage && postDid + ? blobRefToSrc(post.record.coverImage.ref, postDid) + : undefined; + const commonProps = { href: docUrl, title: post.record.title, @@ -77,10 +90,24 @@ export function StandardSitePostItemView({ }; if (size === "large") { - return ; + return ( + + ); } if (size === "medium") { - return ; + return ( + + ); } return ; } -- 2.51.2