From 28fa5e4919ccf24073ccc92d88efb7e4b73b0b2b Mon Sep 17 00:00:00 2001 From: Paul Frazee Date: Sun, 10 Dec 2023 12:01:34 -0800 Subject: Add "Who can reply" controls [WIP] (#1954) * Add threadgating * UI improvements * More ui work * Remove comment * Tweak colors * Add missing keys * Tweak sizing * Only show composer option on non-reply * Flex wrap fix * Move the threadgate control to the top of the composer --- src/view/com/post-thread/PostThreadItem.tsx | 290 +++++++++++++++------------- 1 file changed, 151 insertions(+), 139 deletions(-) (limited to 'src/view/com/post-thread/PostThreadItem.tsx') diff --git a/src/view/com/post-thread/PostThreadItem.tsx b/src/view/com/post-thread/PostThreadItem.tsx index a2aa3716e..2636fdfbd 100644 --- a/src/view/com/post-thread/PostThreadItem.tsx +++ b/src/view/com/post-thread/PostThreadItem.tsx @@ -44,6 +44,7 @@ import {Shadow, usePostShadow, POST_TOMBSTONE} from '#/state/cache/post-shadow' import {ThreadPost} from '#/state/queries/post-thread' import {LabelInfo} from '../util/moderation/LabelInfo' import {useSession} from '#/state/session' +import {WhoCanReply} from '../threadgate/WhoCanReply' export function PostThreadItem({ post, @@ -441,6 +442,7 @@ let PostThreadItemLoaded = ({ + ) } else { @@ -450,164 +452,174 @@ let PostThreadItemLoaded = ({ const isThreadedChildAdjacentBot = isThreadedChild && nextPost?.ctx.depth === depth return ( - - - - - - - {!isThreadedChild && showParentReplyLine && ( - - )} - - - - - {!isThreadedChild && ( - - + <> + + + - {showChildReplyLine && ( + + + {!isThreadedChild && showParentReplyLine && ( )} - )} + - - - - {richText?.text ? ( - - + {!isThreadedChild && ( + + + + {showChildReplyLine && ( + + )} - ) : undefined} - {limitLines ? ( - + - ) : undefined} - {post.embed && ( - - + {richText?.text ? ( + + + + ) : undefined} + {limitLines ? ( + + ) : undefined} + {post.embed && ( + - - )} - + ignoreMute={isEmbedByEmbedder(post.embed, post.author.did)} + ignoreQuoteDecisions> + + + )} + + - - {hasMore ? ( - - - More - - - - ) : undefined} - - + {hasMore ? ( + + + More + + + + ) : undefined} + + + + ) } } -- cgit 1.4.1