diff --git a/app/lish/[did]/[publication]/[rkey]/Interactions/Interactions.tsx b/app/lish/[did]/[publication]/[rkey]/Interactions/Interactions.tsx index ec943fd5..5af450ce 100644 --- a/app/lish/[did]/[publication]/[rkey]/Interactions/Interactions.tsx +++ b/app/lish/[did]/[publication]/[rkey]/Interactions/Interactions.tsx @@ -34,6 +34,7 @@ export const Interactions = (props: { commentsCount: number; compact?: boolean; className?: string; + showComments?: boolean; }) => { let { drawerOpen, drawer } = useInteractionState(); @@ -52,17 +53,19 @@ export const Interactions = (props: { {props.quotesCount}{" "} {!props.compact && `Quote${props.quotesCount === 1 ? "" : "s"}`} - + {props.showComments === false ? null : ( + + )} ); }; diff --git a/app/lish/[did]/[publication]/[rkey]/PostHeader/PostHeader.tsx b/app/lish/[did]/[publication]/[rkey]/PostHeader/PostHeader.tsx index 251446f2..7d35b88f 100644 --- a/app/lish/[did]/[publication]/[rkey]/PostHeader/PostHeader.tsx +++ b/app/lish/[did]/[publication]/[rkey]/PostHeader/PostHeader.tsx @@ -14,6 +14,7 @@ export function PostHeader(props: { data: PostPageData; name: string; profile: ProfileViewDetailed; + preferences: { showComments?: boolean }; }) { let { identity } = useIdentityData(); let document = props.data; @@ -92,6 +93,7 @@ export function PostHeader(props: { ) : null} |{" "} ; bskyPostData: AppBskyFeedDefs.PostView[]; + preferences: { showComments?: boolean }; }) { let { identity } = useIdentityData(); let { drawerOpen } = useInteractionState(); @@ -62,7 +64,12 @@ export function PostPage({
- + diff --git a/app/lish/[did]/[publication]/[rkey]/page.tsx b/app/lish/[did]/[publication]/[rkey]/page.tsx index 9dba7398..3ce8ae47 100644 --- a/app/lish/[did]/[publication]/[rkey]/page.tsx +++ b/app/lish/[did]/[publication]/[rkey]/page.tsx @@ -160,6 +160,7 @@ export default async function Post(props: { */} diff --git a/app/lish/createPub/UpdatePubForm.tsx b/app/lish/createPub/UpdatePubForm.tsx index 2f61301f..34935810 100644 --- a/app/lish/createPub/UpdatePubForm.tsx +++ b/app/lish/createPub/UpdatePubForm.tsx @@ -31,6 +31,11 @@ export const EditPubForm = () => { ? true : record.preferences.showInDiscover, ); + let [showComments, setShowComments] = useState( + record?.preferences?.showComments === undefined + ? true + : record.preferences.showComments, + ); let [descriptionValue, setDescriptionValue] = useState( record?.description || "", ); @@ -62,6 +67,7 @@ export const EditPubForm = () => { iconFile: iconFile, preferences: { showInDiscover: showInDiscover, + showComments: showComments, }, }); toast({ type: "success", content: "Updated!" }); @@ -155,6 +161,15 @@ export const EditPubForm = () => {

+ + setShowComments(e.target.checked)} + > +
+

Show comments on posts

+
+

diff --git a/lexicons/api/lexicons.ts b/lexicons/api/lexicons.ts index e77f2a5c..41686974 100644 --- a/lexicons/api/lexicons.ts +++ b/lexicons/api/lexicons.ts @@ -160,6 +160,10 @@ export const schemaDict = { type: 'boolean', default: true, }, + showComments: { + type: 'boolean', + default: true, + }, }, }, theme: { diff --git a/lexicons/api/types/pub/leaflet/publication.ts b/lexicons/api/types/pub/leaflet/publication.ts index 4b20e1c0..00bd9d48 100644 --- a/lexicons/api/types/pub/leaflet/publication.ts +++ b/lexicons/api/types/pub/leaflet/publication.ts @@ -36,6 +36,7 @@ export function validateRecord(v: V) { export interface Preferences { $type?: 'pub.leaflet.publication#preferences' showInDiscover: boolean + showComments: boolean } const hashPreferences = 'preferences' diff --git a/lexicons/pub/leaflet/publication.json b/lexicons/pub/leaflet/publication.json index 43377de5..def5d283 100644 --- a/lexicons/pub/leaflet/publication.json +++ b/lexicons/pub/leaflet/publication.json @@ -48,6 +48,10 @@ "showInDiscover": { "type": "boolean", "default": true + }, + "showComments": { + "type": "boolean", + "default": true } } }, diff --git a/lexicons/src/publication.ts b/lexicons/src/publication.ts index 6b4faa50..0f36ad35 100644 --- a/lexicons/src/publication.ts +++ b/lexicons/src/publication.ts @@ -26,6 +26,7 @@ export const PubLeafletPublication: LexiconDoc = { type: "object", properties: { showInDiscover: { type: "boolean", default: true }, + showComments: { type: "boolean", default: true }, }, }, theme: {