+
+
Tags
+
+
diff --git a/app/lish/[did]/[publication]/[rkey]/Interactions/Interactions.tsx b/app/lish/[did]/[publication]/[rkey]/Interactions/Interactions.tsx
index 06838605..dc4963bf 100644
--- a/app/lish/[did]/[publication]/[rkey]/Interactions/Interactions.tsx
+++ b/app/lish/[did]/[publication]/[rkey]/Interactions/Interactions.tsx
@@ -102,7 +102,6 @@ export function openInteractionDrawer(
export const Interactions = (props: {
quotesCount: number;
commentsCount: number;
- compact?: boolean;
className?: string;
showComments?: boolean;
pageId?: string;
@@ -120,32 +119,99 @@ export const Interactions = (props: {
}
};
+ const tags = (data?.data as any)?.tags as string[] | undefined;
+ const tagCount = tags?.length || 0;
+ return (
+
+ {tagCount > 0 && }
+
+ {props.quotesCount > 0 && (
+
+ )}
+ {props.showComments === false ? null : (
+
+ )}
+
+ );
+};
+
+export const ExpandedInteractions = (props: {
+ quotesCount: number;
+ commentsCount: number;
+ className?: string;
+ showComments?: boolean;
+ pageId?: string;
+}) => {
+ const data = useContext(PostPageContext);
+ const document_uri = data?.uri;
+ if (!document_uri)
+ throw new Error("document_uri not available in PostPageContext");
+
+ let { drawerOpen, drawer, pageId } = useInteractionState(document_uri);
+
+ const handleQuotePrefetch = () => {
+ if (data?.quotesAndMentions) {
+ prefetchQuotesData(data.quotesAndMentions);
+ }
+ };
+
+ const tags = (data?.data as any)?.tags as string[] | undefined;
+ const tagCount = tags?.length || 0;
return (
- {props.compact && }
-
+ )}
{props.showComments === false ? null : (
{
if (!drawerOpen || drawer !== "comments" || pageId !== props.pageId)
openInteractionDrawer("comments", document_uri, props.pageId);
@@ -154,9 +220,7 @@ export const Interactions = (props: {
aria-label="Post comments"
>
{" "}
- {props.compact ? (
- props.commentsCount
- ) : props.commentsCount > 0 ? (
+ {props.commentsCount > 0 ? (
{`${props.commentsCount} Comment${props.commentsCount === 1 ? "" : "s"}`}
@@ -165,41 +229,33 @@ export const Interactions = (props: {
)}
)}
- {!props.compact && }
);
};
-const TagPopover = () => {
- const data = useContext(PostPageContext);
- const tags = (data?.data as any)?.tags as string[] | undefined;
- const tagCount = tags?.length || 0;
-
- if (tagCount === 0) return null;
-
+const TagPopover = (props: {
+ tagCount: number;
+ tags: string[] | undefined;
+}) => {
return (
- {tagCount}
+ {props.tagCount}
}
>
-
+
);
};
-const TagList = (props: { className?: string }) => {
- const data = useContext(PostPageContext);
- const tags = (data?.data as any)?.tags as string[] | undefined;
-
- if (!tags || tags.length === 0) return null;
-
+const TagList = (props: { className?: string; tags: string[] | undefined }) => {
+ if (!props.tags) return;
return (
- {tags.map((tag, index) => (
+ {props.tags.map((tag, index) => (
))}
diff --git a/app/lish/[did]/[publication]/[rkey]/LinearDocumentPage.tsx b/app/lish/[did]/[publication]/[rkey]/LinearDocumentPage.tsx
index 89995b47..42b1f0e5 100644
--- a/app/lish/[did]/[publication]/[rkey]/LinearDocumentPage.tsx
+++ b/app/lish/[did]/[publication]/[rkey]/LinearDocumentPage.tsx
@@ -11,6 +11,7 @@ import { getPublicationURL } from "app/lish/createPub/getPublicationURL";
import { SubscribeWithBluesky } from "app/lish/Subscribe";
import { EditTiny } from "components/Icons/EditTiny";
import {
+ ExpandedInteractions,
getCommentCount,
getQuoteCount,
Interactions,
@@ -84,7 +85,7 @@ export function LinearDocumentPage({
did={did}
prerenderedCodeBlocks={prerenderedCodeBlocks}
/>
-
{!isSubpage && (
<>
-
{identity &&
identity.atp_did ===
diff --git a/app/lish/[did]/[publication]/[rkey]/PostFooter.tsx b/app/lish/[did]/[publication]/[rkey]/PostFooter.tsx
index 28918896..91c442d7 100644
--- a/app/lish/[did]/[publication]/[rkey]/PostFooter.tsx
+++ b/app/lish/[did]/[publication]/[rkey]/PostFooter.tsx
@@ -5,7 +5,7 @@ import { EditTiny } from "components/Icons/EditTiny";
import { useIdentityData } from "components/IdentityProvider";
import { PubLeafletComment } from "lexicons/api";
import { PostPageData } from "./getPostPageData";
-import { Interactions } from "./Interactions/Interactions";
+import { ExpandedInteractions } from "./Interactions/Interactions";
import { decodeQuotePosition } from "./quotePosition";
export const PostFooter = (props: {
@@ -18,8 +18,7 @@ export const PostFooter = (props: {
return;
return (
-
- {
@@ -36,7 +35,6 @@ export const PostFooter = (props: {
).length
}
/>
-
{identity &&
identity.atp_did ===
props.data.documents_in_publications[0]?.publications?.identity_did ? (
diff --git a/app/lish/[did]/[publication]/[rkey]/PostHeader/PostHeader.tsx b/app/lish/[did]/[publication]/[rkey]/PostHeader/PostHeader.tsx
index 4fd3d6a8..6dcfadd1 100644
--- a/app/lish/[did]/[publication]/[rkey]/PostHeader/PostHeader.tsx
+++ b/app/lish/[did]/[publication]/[rkey]/PostHeader/PostHeader.tsx
@@ -90,7 +90,6 @@ export function PostHeader(props: {