diff --git a/src/screens/PostThread/components/ThreadAnchor.tsx b/src/screens/PostThread/components/ThreadAnchor.tsx index 14058af693..eb519be6b8 100644 --- a/src/screens/PostThread/components/ThreadAnchor.tsx +++ b/src/screens/PostThread/components/ThreadAnchor.tsx @@ -36,6 +36,11 @@ import {Link} from '#/view/com/util/Link' import {formatCount} from '#/view/com/util/numeric/format' import {PostEmbeds, PostEmbedViewContext} from '#/view/com/util/post-embeds' import {PreviewableUserAvatar} from '#/view/com/util/UserAvatar' +import { + LINEAR_AVI_WIDTH, + OUTER_SPACE, + REPLY_LINE_WIDTH, +} from '#/screens/PostThread/const' import {atoms as a, useTheme} from '#/alf' import {colors} from '#/components/Admonition' import {Button} from '#/components/Button' @@ -65,9 +70,11 @@ export function ThreadAnchor({ threadgateRecord?: AppBskyFeedThreadgate.Record }) { const postShadow = usePostShadow(item.value.post) + const threadRootUri = item.value.post.record.reply?.root?.uri || item.uri + const isRoot = threadRootUri === item.uri if (postShadow === POST_TOMBSTONE) { - return + return } return ( @@ -75,6 +82,7 @@ export function ThreadAnchor({ // Safeguard from clobbering per-post state below: key={postShadow.uri} item={item} + isRoot={isRoot} postShadow={postShadow} onPostSuccess={onPostSuccess} threadgateRecord={threadgateRecord} @@ -82,34 +90,80 @@ export function ThreadAnchor({ ) } -function PostThreadItemDeleted({hideTopBorder}: {hideTopBorder?: boolean}) { +function PostThreadItemDeleted({isRoot}: {isRoot: boolean}) { const t = useTheme() + return ( - - - - This post has been deleted. - - + <> + + + + + + + + + Post has been deleted + + + + ) } +function ThreadItemAnchorParentReplyLine({isRoot}: {isRoot: boolean}) { + const t = useTheme() + + return !isRoot ? ( + + + + + + ) : null +} + let PostThreadItemLoaded = ({ item, + isRoot, postShadow, onPostSuccess, threadgateRecord, }: { item: Extract + isRoot: boolean postShadow: Shadow onPostSuccess?: (data: OnPostSuccessData) => void threadgateRecord?: AppBskyFeedThreadgate.Record @@ -134,7 +188,6 @@ let PostThreadItemLoaded = ({ ) const threadRootUri = record.reply?.root?.uri || post.uri - const isThreadRoot = threadRootUri === post.uri const authorHref = makeProfileLink(post.author) const authorTitle = post.author.handle const isThreadAuthor = getThreadAuthor(post, record) === currentAccount?.did @@ -191,31 +244,15 @@ let PostThreadItemLoaded = ({ return ( <> - {!isThreadRoot && ( - - - - - - )} +