@@ -147,26 +146,38 @@ function ThreadContent(props: { post: ThreadType; parentUri: string }) {
function ThreadPost(props: {
post: ThreadViewPost;
isMainPost: boolean;
- showReplyLine: boolean;
- parentUri: string;
+ pageUri: string;
}) {
- const { post, isMainPost, showReplyLine, parentUri } = props;
+ const { post, isMainPost, pageUri } = props;
const postView = post.post;
- const parent = { type: "thread" as const, uri: parentUri };
+ const page = { type: "thread" as const, uri: pageUri };
+
+ if (isMainPost) {
+ return (
+
+
+
+ );
+ }
return (
-
- {/* Reply line connector */}
- {showReplyLine && (
-
- )}
-
+ {},
+ }}
/>
);
@@ -176,9 +187,10 @@ function Replies(props: {
replies: (ThreadViewPost | NotFoundPost | BlockedPost)[];
depth: number;
parentAuthorDid?: string;
- parentUri: string;
+ pageUri: string;
+ parentPostUri: string;
}) {
- const { replies, depth, parentAuthorDid, parentUri } = props;
+ const { replies, depth, parentAuthorDid, pageUri, parentPostUri } = props;
const collapsedThreads = useThreadState((s) => s.collapsedThreads);
const toggleCollapsed = useThreadState((s) => s.toggleCollapsed);
@@ -198,7 +210,7 @@ function Replies(props: {
: replies;
return (
-
+
{sortedReplies.map((reply, index) => {
if (AppBskyFeedDefs.isNotFoundPost(reply)) {
return (
@@ -231,19 +243,21 @@ function Replies(props: {
return (
toggleCollapsed(uri)}
isCollapsed={isCollapsed}
depth={props.depth}
/>
);
})}
- {parentUri && depth > 0 && replies.length > 3 && (
+ {pageUri && depth > 0 && replies.length > 3 && (
@@ -258,12 +272,13 @@ function Replies(props: {
const ReplyPost = (props: {
post: ThreadViewPost;
isLast: boolean;
- parentUri: string;
+ pageUri: string;
+ parentPostUri: string;
toggleCollapsed: (uri: string) => void;
isCollapsed: boolean;
depth: number;
}) => {
- const { post, parentUri } = props;
+ const { post, pageUri, parentPostUri } = props;
const postView = post.post;
const hasReplies = props.post.replies && props.post.replies.length > 0;
@@ -274,14 +289,14 @@ const ReplyPost = (props: {
>
0
? {
onToggle: () => {
- props.toggleCollapsed(props.parentUri);
+ props.toggleCollapsed(parentPostUri);
},
}
: undefined
@@ -291,6 +306,7 @@ const ReplyPost = (props: {
replyOnClick={(e) => {
e.preventDefault();
props.toggleCollapsed(post.post.uri);
+ console.log(post.post.uri);
}}
onEmbedClick={(e) => e.stopPropagation()}
className="text-sm z-10"
@@ -300,7 +316,8 @@ const ReplyPost = (props: {
{!props.isCollapsed && (
= 3 && (
View more replies
diff --git a/components/Blocks/BlueskyPostBlock/BlueskyEmbed.tsx b/components/Blocks/BlueskyPostBlock/BlueskyEmbed.tsx
index 5d8eaefb..192306cc 100644
--- a/components/Blocks/BlueskyPostBlock/BlueskyEmbed.tsx
+++ b/components/Blocks/BlueskyPostBlock/BlueskyEmbed.tsx
@@ -15,6 +15,7 @@ export const BlueskyEmbed = (props: {
embed: Exclude;
postUrl?: string;
className?: string;
+ compact?: boolean;
}) => {
// check this file from bluesky for ref
// https://github.com/bluesky-social/social-app/blob/main/bskyembed/src/components/embed.tsx
@@ -22,7 +23,7 @@ export const BlueskyEmbed = (props: {
case AppBskyEmbedImages.isView(props.embed):
let imageEmbed = props.embed;
return (
-
+
{imageEmbed.images.map(
(
image: {
@@ -69,7 +70,7 @@ export const BlueskyEmbed = (props: {
let isGif = externalEmbed.external.uri.includes(".gif");
if (isGif) {
return (
-
+

{externalEmbed.external.thumb === undefined ? null : (
<>
-
+
-
+ {!props.compact &&
}
>
)}
-
-
-
{externalEmbed.external.title}
-
+
+
+
{externalEmbed.external.title}
+
{externalEmbed.external.description}
-
+
{externalEmbed.external.uri}
@@ -117,7 +123,7 @@ export const BlueskyEmbed = (props: {
: 16 / 9;
return (
{record.author.avatar && (