diff --git a/src/components/WhoCanReply.tsx b/src/components/WhoCanReply.tsx index 0a777dd4a9..a570c1ca78 100644 --- a/src/components/WhoCanReply.tsx +++ b/src/components/WhoCanReply.tsx @@ -35,8 +35,8 @@ import {useDialogControl} from '#/components/Dialog' import {CircleBanSign_Stroke2_Corner0_Rounded as CircleBanSign} from '#/components/icons/CircleBanSign' import {Earth_Stroke2_Corner0_Rounded as Earth} from '#/components/icons/Globe' import {Group3_Stroke2_Corner0_Rounded as Group} from '#/components/icons/Group' +import {InlineLinkText} from '#/components/Link' import {Text} from '#/components/Typography' -import {TextLink} from '../view/com/util/Link' import {PostInteractionSettingsDialog} from './dialogs/PostInteractionSettingsDialog' import {PencilLine_Stroke2_Corner0_Rounded as PencilLine} from './icons/Pencil' @@ -231,6 +231,7 @@ export function WhoCanReply({ control={infoDialogControl} post={post} settings={settings} + postgate={postgate} /> )} @@ -256,79 +257,90 @@ function WhoCanReplyDialog({ control, post, settings, + postgate, }: { control: Dialog.DialogControlProps post: AppBskyFeedDefs.PostView settings: ThreadgateAllowUISetting[] -}) { - return ( - - - - - ) -} - -function WhoCanReplyDialogInner({ - post, - settings, -}: { - post: AppBskyFeedDefs.PostView - settings: ThreadgateAllowUISetting[] + postgate: AppBskyFeedPostgate.Record }) { const {_} = useLingui() return ( - - - - Who can reply? - - - - + + + + + + Who can interact with this post? + + + + + ) } function Rules({ post, settings, + postgate, }: { post: AppBskyFeedDefs.PostView settings: ThreadgateAllowUISetting[] + postgate: AppBskyFeedPostgate.Record }) { const t = useTheme() + const noOneCanQuote = + postgate.quotepostRules?.length === 1 && + postgate.quotepostRules[0]?.$type === embeddingRules.disableRule.$type + return ( - - {!settings.length ? ( - Everybody can reply - ) : settings[0].type === 'nobody' ? ( - Replies to this thread are disabled - ) : ( - - Only{' '} - {settings.map((rule, i) => ( - <> - - - - ))}{' '} - can reply - - )} - + <> + + {settings[0].type === 'everybody' ? ( + Everybody can reply to this post. + ) : settings[0].type === 'nobody' ? ( + Replies to this post are disabled + ) : ( + + Only{' '} + {settings.map((rule, i) => ( + <> + + + + ))}{' '} + can reply. + + )}{' '} + + + {noOneCanQuote ? ( + No one but the author can quote this post. + ) : ( + Anyone can quote this post. + )} + + ) } @@ -341,7 +353,6 @@ function Rule({ post: AppBskyFeedDefs.PostView lists: AppBskyGraphDefs.ListViewBasic[] | undefined }) { - const t = useTheme() if (rule.type === 'mention') { return mentioned users } @@ -349,12 +360,12 @@ function Rule({ return ( users followed by{' '} - + + @{post.author.handle} + ) } @@ -364,12 +375,12 @@ function Rule({ const listUrip = new AtUri(list.uri) return ( - {' '} + + {list.name} + {' '} members ) diff --git a/src/view/com/post-thread/PostThreadItem.tsx b/src/view/com/post-thread/PostThreadItem.tsx index b142bb1017..5910b121d0 100644 --- a/src/view/com/post-thread/PostThreadItem.tsx +++ b/src/view/com/post-thread/PostThreadItem.tsx @@ -683,7 +683,6 @@ function ExpandedPostDetails({ const pal = usePalette('default') const {_} = useLingui() const openLink = useOpenLink() - const isRootPost = !('reply' in post.record) const onTranslatePress = React.useCallback(() => { openLink(translatorUrl) @@ -700,19 +699,17 @@ function ExpandedPostDetails({ s.mb10, ]}> {niceDate(post.indexedAt)} - {isRootPost && ( - - )} + {needsTranslation && ( <> ·