a tool for shared writing and social publishing
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

add comments and quotes to published list on dash

+44 -14
+5 -1
app/api/rpc/[command]/get_publication_data.ts
··· 28 28 .from("publications") 29 29 .select( 30 30 `*, 31 - documents_in_publications(documents(*)), 31 + documents_in_publications(documents( 32 + *, 33 + comments_on_documents(count), 34 + document_mentions_in_bsky(count) 35 + )), 32 36 publication_subscriptions(*, identities(bsky_profiles(*))), 33 37 publication_domains(*), 34 38 leaflets_in_publications(*,
+39 -13
app/lish/[did]/[publication]/dashboard/PublishedPostsLists.tsx
··· 15 15 import { ShareSmall } from "components/Icons/ShareSmall"; 16 16 import { ShareButton } from "components/ShareOptions"; 17 17 import { SpeedyLink } from "components/SpeedyLink"; 18 + import { QuoteTiny } from "components/Icons/QuoteTiny"; 19 + import { CommentTiny } from "components/Icons/CommentTiny"; 18 20 19 21 export function PublishedPostsList() { 20 22 let { data: publication } = usePublicationData(); ··· 47 49 ); 48 50 let uri = new AtUri(doc.documents.uri); 49 51 let record = doc.documents.data as PubLeafletDocument.Record; 52 + let quotes = 53 + doc.documents.document_mentions_in_bsky[0]?.count || 0; 54 + let comments = 55 + doc.documents.comments_on_documents[0]?.count || 0; 50 56 51 57 return ( 52 58 <Fragment key={doc.documents?.uri}> ··· 80 86 {record.description} 81 87 </p> 82 88 ) : null} 83 - {record.publishedAt ? ( 84 - <p className="text-sm text-tertiary pt-3"> 85 - Published{" "} 86 - {new Date(record.publishedAt).toLocaleDateString( 87 - undefined, 88 - { 89 - year: "numeric", 90 - month: "long", 91 - day: "2-digit", 92 - }, 93 - )} 94 - </p> 95 - ) : null} 89 + <div className="text-sm text-tertiary flex gap-1 flex-wrap pt-3"> 90 + {record.publishedAt ? ( 91 + <p className="text-sm text-tertiary"> 92 + Published{" "} 93 + {new Date(record.publishedAt).toLocaleDateString( 94 + undefined, 95 + { 96 + year: "numeric", 97 + month: "long", 98 + day: "2-digit", 99 + }, 100 + )} 101 + </p> 102 + ) : null} 103 + {(comments > 0 || quotes > 0) && record.publishedAt ? " | " : ""} 104 + {quotes > 0 && ( 105 + <SpeedyLink 106 + href={`${getPublicationURL(publication)}/${uri.rkey}?interactionDrawer=quotes`} 107 + className="flex flex-row gap-1 text-sm text-tertiary items-center" 108 + > 109 + <QuoteTiny /> {quotes} 110 + </SpeedyLink> 111 + )} 112 + {comments > 0 && quotes > 0 ? " " : ""} 113 + {comments > 0 && ( 114 + <SpeedyLink 115 + href={`${getPublicationURL(publication)}/${uri.rkey}?interactionDrawer=comments`} 116 + className="flex flex-row gap-1 text-sm text-tertiary items-center" 117 + > 118 + <CommentTiny /> {comments} 119 + </SpeedyLink> 120 + )} 121 + </div> 96 122 </div> 97 123 </div> 98 124 <hr className="last:hidden border-border-light" />