From 0654d11c201bd062ac544937613b173c46783f6a Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Tue, 14 Apr 2026 17:36:02 -0500 Subject: [PATCH] Align on the offset hack we need for posts with no content --- src/components/images/Gallery/const.ts | 3 + src/components/images/Gallery/index.tsx | 2 + .../components/ThreadItemAnchor.tsx | 2 +- .../PostThread/components/ThreadItemPost.tsx | 17 +- src/view/com/post/Post.tsx | 185 +++++++++--------- src/view/com/posts/PostFeedItem.tsx | 13 +- 6 files changed, 123 insertions(+), 99 deletions(-) diff --git a/src/components/images/Gallery/const.ts b/src/components/images/Gallery/const.ts index 443b65ecb8..2c7918349b 100644 --- a/src/components/images/Gallery/const.ts +++ b/src/components/images/Gallery/const.ts @@ -1,3 +1,6 @@ export const ITEM_GAP = 8 // tokens.space.sm export const MIN_ASPECT_RATIO = 2 / 3 // portrait limit export const MAX_ASPECT_RATIO = 3 / 2 // landscape limit + +export const POST_META_NO_CONTENT_OFFSET = {paddingTop: 10} +export const POST_EMBED_NO_CONTENT_OFFSET = {paddingTop: 6} diff --git a/src/components/images/Gallery/index.tsx b/src/components/images/Gallery/index.tsx index 6c048f61ef..c7e7b206e0 100644 --- a/src/components/images/Gallery/index.tsx +++ b/src/components/images/Gallery/index.tsx @@ -41,6 +41,8 @@ import {Text} from '#/components/Typography' import {useAnalytics} from '#/analytics' import {IS_WEB} from '#/env' +export * from './const' + interface GalleryProps { images: AppBskyEmbedImages.ViewImage[] onPress?: ( diff --git a/src/screens/PostThread/components/ThreadItemAnchor.tsx b/src/screens/PostThread/components/ThreadItemAnchor.tsx index 2f1033e526..17c8e54be8 100644 --- a/src/screens/PostThread/components/ThreadItemAnchor.tsx +++ b/src/screens/PostThread/components/ThreadItemAnchor.tsx @@ -408,7 +408,7 @@ const ThreadItemAnchorInner = memo(function ThreadItemAnchorInner({ ) : undefined} {post.embed && ( - + {post.embed && ( - + { - setHover(true) - }} - onPointerLeave={() => { - setHover(false) - }}> - - {showReplyLine && } - - - - - - - {replyAuthorDid !== '' && ( - - )} - - - + { + setHover(true) + }} + onPointerLeave={() => { + setHover(false) + }}> + + {showReplyLine && } + + + - {richText.text ? ( - - - {limitLines && ( - + + + {replyAuthorDid !== '' && ( + + )} + + + + {richText.text ? ( + + - )} - - ) : undefined} - - {post.embed ? ( - - - - ) : null} - - + {limitLines && ( + + )} + + ) : undefined} + + {post.embed ? ( + + + + ) : null} + + + - - + + ) } @@ -266,9 +276,6 @@ const styles = StyleSheet.create({ layoutContent: { flex: 1, }, - layoutContentNoText: { - paddingTop: 10, - }, alert: { marginBottom: 6, }, diff --git a/src/view/com/posts/PostFeedItem.tsx b/src/view/com/posts/PostFeedItem.tsx index 31e29be305..a8681a34e9 100644 --- a/src/view/com/posts/PostFeedItem.tsx +++ b/src/view/com/posts/PostFeedItem.tsx @@ -34,7 +34,11 @@ import {Link} from '#/view/com/util/Link' import {PostMeta} from '#/view/com/util/PostMeta' import {PreviewableUserAvatar} from '#/view/com/util/UserAvatar' import {atoms as a} from '#/alf' -import {GalleryBleed} from '#/components/images/Gallery' +import { + GalleryBleed, + POST_EMBED_NO_CONTENT_OFFSET, + POST_META_NO_CONTENT_OFFSET, +} from '#/components/images/Gallery' import {ContentHider} from '#/components/moderation/ContentHider' import {LabelsOnMyPost} from '#/components/moderation/LabelsOnMe' import {PostAlerts} from '#/components/moderation/PostAlerts' @@ -364,7 +368,7 @@ let FeedItemInner = ({ } {postEmbed ? ( - +