diff --git a/app/lish/[did]/[publication]/[rkey]/Interactions/Comments/index.tsx b/app/lish/[did]/[publication]/[rkey]/Interactions/Comments/index.tsx
index 34608196..65a72f7a 100644
--- a/app/lish/[did]/[publication]/[rkey]/Interactions/Comments/index.tsx
+++ b/app/lish/[did]/[publication]/[rkey]/Interactions/Comments/index.tsx
@@ -29,6 +29,7 @@ export function CommentsDrawerContent(props: {
document_uri: string;
comments: Comment[];
pageId?: string;
+ noCommentBox?: boolean;
}) {
let { identity } = useIdentityData();
let { localComments } = useInteractionState(props.document_uri);
@@ -55,26 +56,19 @@ export function CommentsDrawerContent(props: {
id={"commentsDrawer"}
className="flex flex-col gap-2 relative text-sm text-secondary"
>
-
+ {!props.noCommentBox && (
+ <>
+ {identity?.atp_did ? (
+
{comments
.sort((a, b) => {
diff --git a/app/lish/[did]/[publication]/[rkey]/Interactions/InteractionDrawer.tsx b/app/lish/[did]/[publication]/[rkey]/Interactions/InteractionDrawer.tsx
index b690925b..d15088e6 100644
--- a/app/lish/[did]/[publication]/[rkey]/Interactions/InteractionDrawer.tsx
+++ b/app/lish/[did]/[publication]/[rkey]/Interactions/InteractionDrawer.tsx
@@ -1,12 +1,17 @@
"use client";
import { Media } from "components/Media";
import { MentionsDrawerContent } from "./Quotes";
-import { InteractionState, useInteractionState } from "./Interactions";
+import {
+ InteractionState,
+ setInteractionState,
+ useInteractionState,
+} from "./Interactions";
import { Json } from "supabase/database.types";
import { Comment, CommentsDrawerContent } from "./Comments";
import { useSearchParams } from "next/navigation";
import { SandwichSpacer } from "components/LeafletLayout";
import { decodeQuotePosition } from "../quotePosition";
+import { CloseTiny } from "components/Icons/CloseTiny";
export const InteractionDrawer = (props: {
showPageBackground: boolean | undefined;
@@ -39,19 +44,44 @@ export const InteractionDrawer = (props: {
{drawer.drawer === "quotes" ? (
-
+ <>
+
+
+ >
) : (
-
+ <>
+
+
Comments
+
+
+
+ >
)}
diff --git a/app/lish/[did]/[publication]/[rkey]/Interactions/Quotes.tsx b/app/lish/[did]/[publication]/[rkey]/Interactions/Quotes.tsx
index a1190b32..1c39cde9 100644
--- a/app/lish/[did]/[publication]/[rkey]/Interactions/Quotes.tsx
+++ b/app/lish/[did]/[publication]/[rkey]/Interactions/Quotes.tsx
@@ -86,13 +86,7 @@ export const MentionsDrawerContent = (props: {
});
return (
-
-
+ <>
{props.quotesAndMentions.length === 0 ? (
no quotes yet!
@@ -160,7 +154,7 @@ export const MentionsDrawerContent = (props: {
)}
)}
-
+ >
);
};
diff --git a/app/lish/[did]/[publication]/[rkey]/getPostPageData.ts b/app/lish/[did]/[publication]/[rkey]/getPostPageData.ts
index 9f7f44a2..bbf8ef25 100644
--- a/app/lish/[did]/[publication]/[rkey]/getPostPageData.ts
+++ b/app/lish/[did]/[publication]/[rkey]/getPostPageData.ts
@@ -3,8 +3,6 @@ import { AtUri } from "@atproto/syntax";
import {
normalizeDocumentRecord,
normalizePublicationRecord,
- type NormalizedDocument,
- type NormalizedPublication,
} from "src/utils/normalizeRecords";
import { PubLeafletPublication, SiteStandardPublication } from "lexicons/api";
import { documentUriFilter } from "src/utils/uriHelpers";
@@ -33,12 +31,15 @@ export async function getPostPageData(did: string, rkey: string) {
if (!document) return null;
// Normalize the document record - this is the primary way consumers should access document data
- const normalizedDocument = normalizeDocumentRecord(document.data, document.uri);
+ const normalizedDocument = normalizeDocumentRecord(
+ document.data,
+ document.uri,
+ );
if (!normalizedDocument) return null;
// Normalize the publication record - this is the primary way consumers should access publication data
const normalizedPublication = normalizePublicationRecord(
- document.documents_in_publications[0]?.publications?.record
+ document.documents_in_publications[0]?.publications?.record,
);
// Fetch constellation backlinks for mentions
@@ -83,7 +84,10 @@ export async function getPostPageData(did: string, rkey: string) {
// Filter and sort documents by publishedAt
const sortedDocs = allDocs
.map((dip) => {
- const normalizedData = normalizeDocumentRecord(dip?.documents?.data, dip?.documents?.uri);
+ const normalizedData = normalizeDocumentRecord(
+ dip?.documents?.data,
+ dip?.documents?.uri,
+ );
return {
uri: dip?.documents?.uri,
title: normalizedData?.title,
@@ -98,7 +102,9 @@ export async function getPostPageData(did: string, rkey: string) {
);
// Find current document index
- const currentIndex = sortedDocs.findIndex((doc) => doc.uri === document.uri);
+ const currentIndex = sortedDocs.findIndex(
+ (doc) => doc.uri === document.uri,
+ );
if (currentIndex !== -1) {
prevNext = {
@@ -122,13 +128,18 @@ export async function getPostPageData(did: string, rkey: string) {
// Build explicit publication context for consumers
const rawPub = document.documents_in_publications[0]?.publications;
- const publication = rawPub ? {
- uri: rawPub.uri,
- name: rawPub.name,
- identity_did: rawPub.identity_did,
- record: rawPub.record as PubLeafletPublication.Record | SiteStandardPublication.Record | null,
- publication_subscriptions: rawPub.publication_subscriptions || [],
- } : null;
+ const publication = rawPub
+ ? {
+ uri: rawPub.uri,
+ name: rawPub.name,
+ identity_did: rawPub.identity_did,
+ record: rawPub.record as
+ | PubLeafletPublication.Record
+ | SiteStandardPublication.Record
+ | null,
+ publication_subscriptions: rawPub.publication_subscriptions || [],
+ }
+ : null;
return {
...document,
diff --git a/components/PostListing.tsx b/components/PostListing.tsx
index 324cfcaf..ae6e619b 100644
--- a/components/PostListing.tsx
+++ b/components/PostListing.tsx
@@ -15,10 +15,10 @@ import { InteractionPreview, TagPopover } from "./InteractionsPreview";
import { useLocalizedDate } from "src/hooks/useLocalizedDate";
import { useSmoker } from "./Toast";
import { Separator } from "./Layout";
-import { SpeedyLink } from "./SpeedyLink";
import { CommentTiny } from "./Icons/CommentTiny";
import { QuoteTiny } from "./Icons/QuoteTiny";
import { ShareTiny } from "./Icons/ShareTiny";
+import { useSelectedPostListing } from "src/useSelectedPostState";
export const PostListing = (props: Post) => {
let pubRecord = props.publication?.pubRecord as
@@ -149,7 +149,9 @@ export const PostListing = (props: Post) => {
tags={tags}
showComments={pubRecord?.preferences?.showComments !== false}
showMentions={pubRecord?.preferences?.showMentions !== false}
- />{" "}
+ documentUri={props.documents.uri}
+ document={postRecord}
+ />