From dad2b37a613871de1ab292e592f293eeb5c4f0de Mon Sep 17 00:00:00 2001 From: celine Date: Sat, 24 Jan 2026 03:23:08 -0500 Subject: [PATCH] use BskyPostContent in the leaflet as well --- .../[rkey]/Blocks/PublishBskyPostBlock.tsx | 126 ++---------------- .../[publication]/[rkey]/BskyPostContent.tsx | 18 ++- .../[rkey]/Interactions/Quotes.tsx | 1 + .../[did]/[publication]/[rkey]/ThreadPage.tsx | 10 -- components/Blocks/BlueskyPostBlock/index.tsx | 76 ++--------- 5 files changed, 38 insertions(+), 193 deletions(-) diff --git a/app/lish/[did]/[publication]/[rkey]/Blocks/PublishBskyPostBlock.tsx b/app/lish/[did]/[publication]/[rkey]/Blocks/PublishBskyPostBlock.tsx index 3343af46..703dc5a6 100644 --- a/app/lish/[did]/[publication]/[rkey]/Blocks/PublishBskyPostBlock.tsx +++ b/app/lish/[did]/[publication]/[rkey]/Blocks/PublishBskyPostBlock.tsx @@ -13,6 +13,7 @@ import { } from "components/Blocks/BlueskyPostBlock/BlueskyEmbed"; import { BlueskyRichText } from "components/Blocks/BlueskyPostBlock/BlueskyRichText"; import { openPage } from "../PostPages"; +import { BskyPostContent } from "../BskyPostContent"; export const PubBlueskyPostBlock = (props: { post: PostView; @@ -49,6 +50,8 @@ export const PubBlueskyPostBlock = (props: { //getting the url to the post let postId = post.uri.split("/")[4]; + let postView = post as PostView; + let url = `https://bsky.app/profile/${post.author.handle}/post/${postId}`; const parent = props.pageId @@ -56,119 +59,16 @@ export const PubBlueskyPostBlock = (props: { : undefined; return ( -
- {post.author && record && ( - <> -
- {post.author.avatar && ( - {`${post.author?.displayName}'s - )} -
-
- {post.author?.displayName} -
- e.stopPropagation()} - > - @{post.author?.handle} - -
-
- -
-
-
-                    {BlueskyRichText({
-                      record: record as AppBskyFeedPost.Record | null,
-                    })}
-                  
-
- {post.embed && ( -
e.stopPropagation()}> - -
- )} -
- - )} -
- -
- {post.replyCount != null && post.replyCount > 0 && ( - <> - e.stopPropagation()} - > - {post.replyCount} - - - - - )} - {post.quoteCount != null && post.quoteCount > 0 && ( - <> - e.stopPropagation()} - > - {post.quoteCount} - - - - - )} - - e.stopPropagation()} - > - - -
-
-
+ ); } }; - -const ClientDate = (props: { date?: string }) => { - let pageLoaded = useHasPageLoaded(); - const formattedDate = useLocalizedDate( - props.date || new Date().toISOString(), - { - month: "short", - day: "numeric", - year: "numeric", - hour: "numeric", - minute: "numeric", - hour12: true, - }, - ); - - if (!pageLoaded) return null; - - return
{formattedDate}
; -}; diff --git a/app/lish/[did]/[publication]/[rkey]/BskyPostContent.tsx b/app/lish/[did]/[publication]/[rkey]/BskyPostContent.tsx index 6305dfeb..571cddef 100644 --- a/app/lish/[did]/[publication]/[rkey]/BskyPostContent.tsx +++ b/app/lish/[did]/[publication]/[rkey]/BskyPostContent.tsx @@ -19,7 +19,7 @@ type PostView = AppBskyFeedDefs.PostView; export function BskyPostContent(props: { post: PostView; - parent: OpenPage; + parent: OpenPage | undefined; avatarSize?: "tiny" | "small" | "medium" | "large" | "giant"; className?: string; showEmbed?: boolean; @@ -87,7 +87,7 @@ export function BskyPostContent(props: { className={`flex flex-col min-w-0 w-full z-0 ${props.replyLine ? "mt-2" : ""}`} >