From 356870ef60a7d4e7d3a605ee8d56b1994ac020a1 Mon Sep 17 00:00:00 2001 From: Paul Frazee Date: Thu, 15 Dec 2022 11:43:05 -0600 Subject: Just do full renders of parent posts in the feed --- src/view/com/post/Post.tsx | 15 ++- src/view/com/posts/FeedItem.tsx | 241 +++++++++++++++++---------------------- src/view/com/util/PostEmbeds.tsx | 2 +- 3 files changed, 119 insertions(+), 139 deletions(-) (limited to 'src') diff --git a/src/view/com/post/Post.tsx b/src/view/com/post/Post.tsx index 97bec92ea..6faae3ddd 100644 --- a/src/view/com/post/Post.tsx +++ b/src/view/com/post/Post.tsx @@ -16,6 +16,7 @@ import {PostThreadViewModel} from '../../../state/models/post-thread-view' import {Link} from '../util/Link' import {UserInfoText} from '../util/UserInfoText' import {PostMeta} from '../util/PostMeta' +import {PostEmbeds} from '../util/PostEmbeds' import {PostCtrls} from '../util/PostCtrls' import {RichText} from '../util/RichText' import * as Toast from '../util/Toast' @@ -26,10 +27,12 @@ import {s, colors} from '../../lib/styles' export const Post = observer(function Post({ uri, initView, + showReplyLine, style, }: { uri: string initView?: PostThreadViewModel + showReplyLine?: boolean style?: StyleProp }) { const store = useStores() @@ -131,11 +134,12 @@ export const Post = observer(function Post({ return ( + {showReplyLine && } + } + const isChild = + item._isThreadChild || + (!item.repostedBy && !item.trendedBy && item.additionalParentPost?.thread) const outerStyles = [ styles.outer, - item._isThreadChild ? styles.outerNoTop : undefined, + isChild ? styles.outerNoTop : undefined, item._isThreadParent ? styles.outerNoBottom : undefined, ] return ( - - {item._isThreadChild && } - {item._isThreadParent && ( - + {isChild && item.additionalParentPost?.thread ? ( + - )} - {item.repostedBy && ( - - - - Reposted by {item.repostedBy.displayName || item.repostedBy.handle} - - - )} - {item.trendedBy && ( - - + {isChild && } + {item._isThreadParent && ( + - - Trending with {item.trendedBy.displayName || item.trendedBy.handle} - - - )} - {item.additionalParentPost ? ( - - - - - - - - {item.additionalParentPost?.thread?.record.text} + )} + {item.repostedBy && ( + + + + Reposted by{' '} + {item.repostedBy.displayName || item.repostedBy.handle} - - - ) : undefined} - - + + )} + {item.trendedBy && ( - + + + Trending with{' '} + {item.trendedBy.displayName || item.trendedBy.handle} + - - - {!item._isThreadChild ? ( - - ) : undefined} - {!item._isThreadChild && replyHref !== '' && ( - - Replying to - - - + )} + + + + + + + + {!item._isThreadChild ? ( + + ) : undefined} + {!item._isThreadChild && replyHref !== '' && ( + + Replying to + + + + + )} + + - )} - - + - - - - + + ) }) @@ -224,7 +220,7 @@ const styles = StyleSheet.create({ padding: 10, }, outerNoTop: { - marginTop: 1, + marginTop: 0, borderTopLeftRadius: 0, borderTopRightRadius: 0, }, @@ -260,35 +256,6 @@ const styles = StyleSheet.create({ marginRight: 4, color: colors.gray4, }, - replyingToLine: { - position: 'absolute', - left: 24, - bottom: -1 * REPLYING_TO_LINE_LENGTH + 6, - height: REPLYING_TO_LINE_LENGTH, - borderLeftWidth: 2, - borderLeftColor: colors.gray2, - }, - replyingTo: { - flexDirection: 'row', - backgroundColor: colors.white, - paddingBottom: 8, - paddingRight: 24, - }, - replyingToAvatar: { - marginLeft: 9, - marginRight: 19, - marginTop: 1, - }, - replyingToTextContainer: { - flex: 1, - flexDirection: 'row', - height: 34, - alignItems: 'center', - }, - replyingToText: { - flex: 1, - color: colors.gray5, - }, layout: { flexDirection: 'row', }, diff --git a/src/view/com/util/PostEmbeds.tsx b/src/view/com/util/PostEmbeds.tsx index ea15dc9ca..5e886409e 100644 --- a/src/view/com/util/PostEmbeds.tsx +++ b/src/view/com/util/PostEmbeds.tsx @@ -121,7 +121,7 @@ export function PostEmbeds({ const styles = StyleSheet.create({ imagesContainer: { - marginBottom: 20, + marginBottom: 10, }, imagesWidthSpacer: { width: 5, -- cgit 1.4.1