+ {props.post.replyCount != null && props.post.replyCount > 0 && (
<>
-
- {linksEnabled ? (
+ {props.replyCountOnClick ? (
- {post.replyCount}
+ {props.post.replyCount}
) : (
-
- {post.replyCount}
+
+ {props.post.replyCount}
)}
>
)}
- {post.quoteCount != null && post.quoteCount > 0 && (
- <>
-
-
- {post.quoteCount}
-
-
- >
- )}
- {showBlueskyLink && (
+ {props.post.quoteCount != null && props.post.quoteCount > 0 && (
<>
-
-
-
-
+ {props.quoteCountOnClick ? (
+
+
+ {props.post.quoteCount}
+
+ ) : (
+
+
+ {props.post.quoteCount}
+
+ )}
>
)}
diff --git a/app/lish/[did]/[publication]/[rkey]/Interactions/Comments/index.tsx b/app/lish/[did]/[publication]/[rkey]/Interactions/Comments/index.tsx
index 33e771f0..fde12e67 100644
--- a/app/lish/[did]/[publication]/[rkey]/Interactions/Comments/index.tsx
+++ b/app/lish/[did]/[publication]/[rkey]/Interactions/Comments/index.tsx
@@ -25,7 +25,7 @@ export type Comment = {
uri: string;
bsky_profiles: { record: Json; did: string } | null;
};
-export function Comments(props: {
+export function CommentsDrawerContent(props: {
document_uri: string;
comments: Comment[];
pageId?: string;
diff --git a/app/lish/[did]/[publication]/[rkey]/Interactions/InteractionDrawer.tsx b/app/lish/[did]/[publication]/[rkey]/Interactions/InteractionDrawer.tsx
index 9283aa1c..b690925b 100644
--- a/app/lish/[did]/[publication]/[rkey]/Interactions/InteractionDrawer.tsx
+++ b/app/lish/[did]/[publication]/[rkey]/Interactions/InteractionDrawer.tsx
@@ -1,9 +1,9 @@
"use client";
import { Media } from "components/Media";
-import { Quotes } from "./Quotes";
+import { MentionsDrawerContent } from "./Quotes";
import { InteractionState, useInteractionState } from "./Interactions";
import { Json } from "supabase/database.types";
-import { Comment, Comments } from "./Comments";
+import { Comment, CommentsDrawerContent } from "./Comments";
import { useSearchParams } from "next/navigation";
import { SandwichSpacer } from "components/LeafletLayout";
import { decodeQuotePosition } from "../quotePosition";
@@ -42,9 +42,12 @@ export const InteractionDrawer = (props: {
className={`opaque-container h-full w-full px-3 sm:px-4 pt-2 sm:pt-3 pb-6 overflow-scroll ${props.showPageBackground ? "rounded-l-none! rounded-r-lg! -ml-[1px]" : "rounded-lg! sm:ml-4"}`}
>
{drawer.drawer === "quotes" ? (
-
+
) : (
-
{
@@ -85,18 +86,13 @@ export const Quotes = (props: {
});
return (
-
-
- Quotes
-
-
+
+
{props.quotesAndMentions.length === 0 ? (
no quotes yet!
@@ -108,59 +104,58 @@ export const Quotes = (props: {
) : (
-
- {/* Quotes with links (quoted content) */}
- {quotesWithLinks.map((q, index) => {
- const pv = postViewMap.get(q.uri);
- if (!pv || !q.link) return null;
- const url = new URL(q.link);
- const quoteParam = url.pathname.split("/l-quote/")[1];
- if (!quoteParam) return null;
- const quotePosition = decodeQuotePosition(quoteParam);
- if (!quotePosition) return null;
- return (
-
- );
- })}
-
+
+ {quotesWithLinks.length > 0 && (
+
+ Quotes
+ {/* Quotes with links (quoted content) */}
+ {quotesWithLinks.map((q, index) => {
+ return (
+
+
+
+ );
+ })}
+
+ )}
{/* Direct post mentions (without quoted content) */}
{directMentions.length > 0 && (
-
Post Mentions
+
+ Mentions on Bluesky
+
{directMentions.map((q, index) => {
- const pv = postViewMap.get(q.uri);
- if (!pv) return null;
+ const post = postViewMap.get(q.uri);
+ if (!post) return null;
+
+ const parent = { type: "thread" as const, uri: q.uri };
return (
-
+
);
})}
@@ -172,6 +167,44 @@ export const Quotes = (props: {
);
};
+const Quote = (props: {
+ q: {
+ uri: string;
+ link?: string;
+ };
+ index: number;
+ did: string;
+ postViewMap: Map
;
+}) => {
+ const post = props.postViewMap.get(props.q.uri);
+ if (!post || !props.q.link) return null;
+ const parent = { type: "thread" as const, uri: props.q.uri };
+ const url = new URL(props.q.link);
+ const quoteParam = url.pathname.split("/l-quote/")[1];
+ if (!quoteParam) return null;
+ const quotePosition = decodeQuotePosition(quoteParam);
+ if (!quotePosition) return null;
+
+ return (
+
+ );
+};
+
export const QuoteContent = (props: {
position: QuotePosition;
index: number;
@@ -206,12 +239,15 @@ export const QuoteContent = (props: {
className="quoteSectionQuote text-secondary text-sm text-left hover:cursor-pointer"
onClick={(e) => {
if (props.position.pageId)
- flushSync(() => openPage(undefined, { type: "doc", id: props.position.pageId! }));
+ flushSync(() =>
+ openPage(undefined, { type: "doc", id: props.position.pageId! }),
+ );
let scrollMargin = isMobile
? 16
: e.currentTarget.getBoundingClientRect().top;
let scrollContainerId = `post-page-${props.position.pageId ?? document_uri}`;
- let scrollContainer = window.document.getElementById(scrollContainerId);
+ let scrollContainer =
+ window.document.getElementById(scrollContainerId);
let el = window.document.getElementById(
props.position.start.block.join("."),
);
@@ -244,72 +280,6 @@ export const QuoteContent = (props: {
);
};
-export const BskyPost = (props: {
- uri: string;
- rkey: string;
- content: string;
- user: string;
- handle: string;
- profile: ProfileViewBasic;
- replyCount?: number;
- quoteCount?: number;
-}) => {
- const handleOpenThread = () => {
- openPage(undefined, { type: "thread", uri: props.uri });
- };
-
- return (
-
- {props.profile.avatar && (
-

- )}
-
-
-
{props.content}
-
- {props.replyCount != null && props.replyCount > 0 && (
- e.stopPropagation()}
- className="flex items-center gap-1 text-tertiary text-xs hover:text-accent-contrast"
- >
-
- {props.replyCount} {props.replyCount === 1 ? "reply" : "replies"}
-
- )}
- {props.quoteCount != null && props.quoteCount > 0 && (
- e.stopPropagation()}
- className="flex items-center gap-1 text-tertiary text-xs hover:text-accent-contrast"
- >
-
- {props.quoteCount} {props.quoteCount === 1 ? "quote" : "quotes"}
-
- )}
-
-
-
- );
-};
-
function extractQuotedBlocks(
blocks: PubLeafletPagesLinearDocument.Block[],
quotePosition: QuotePosition,
diff --git a/app/lish/[did]/[publication]/[rkey]/PostLinks.tsx b/app/lish/[did]/[publication]/[rkey]/PostLinks.tsx
index 80da034b..0800cbda 100644
--- a/app/lish/[did]/[publication]/[rkey]/PostLinks.tsx
+++ b/app/lish/[did]/[publication]/[rkey]/PostLinks.tsx
@@ -104,7 +104,6 @@ export function QuotesLink(props: {
const handlePrefetch = () => {
prefetchQuotes(postUri);
};
-
return (