Use consistent rendering of avis and post metas in threads

zio/stable
Paul Frazee 2022-12-20 10:33:56 -06:00
parent 99a28c0aae
commit 74d76fbc6a
1 changed files with 15 additions and 40 deletions

View File

@ -114,22 +114,8 @@ export const FeedItem = observer(function FeedItem({
/> />
) : undefined} ) : undefined}
<Link style={outerStyles} href={itemHref} title={itemTitle} noFeedback> <Link style={outerStyles} href={itemHref} title={itemTitle} noFeedback>
{isChild && ( {isChild && <View style={[styles.topReplyLine]} />}
<View {item._isThreadParent && <View style={[styles.bottomReplyLine]} />}
style={[
styles.topReplyLine,
item._isThreadChild ? styles.topReplyLineSmallAvi : undefined,
]}
/>
)}
{item._isThreadParent && (
<View
style={[
styles.bottomReplyLine,
item._isThreadChild ? styles.bottomReplyLineSmallAvi : undefined,
]}
/>
)}
{item.repostedBy && ( {item.repostedBy && (
<Link <Link
style={styles.includeReason} style={styles.includeReason}
@ -159,12 +145,9 @@ export const FeedItem = observer(function FeedItem({
)} )}
<View style={styles.layout}> <View style={styles.layout}>
<View style={styles.layoutAvi}> <View style={styles.layoutAvi}>
<Link <Link href={authorHref} title={item.author.handle}>
href={authorHref}
title={item.author.handle}
style={item._isThreadChild ? {marginLeft: 10} : undefined}>
<UserAvatar <UserAvatar
size={item._isThreadChild ? 30 : 52} size={52}
displayName={item.author.displayName} displayName={item.author.displayName}
handle={item.author.handle} handle={item.author.handle}
avatar={item.author.avatar} avatar={item.author.avatar}
@ -172,19 +155,17 @@ export const FeedItem = observer(function FeedItem({
</Link> </Link>
</View> </View>
<View style={styles.layoutContent}> <View style={styles.layoutContent}>
{!item._isThreadChild ? ( <PostMeta
<PostMeta itemHref={itemHref}
itemHref={itemHref} itemTitle={itemTitle}
itemTitle={itemTitle} authorHref={authorHref}
authorHref={authorHref} authorHandle={item.author.handle}
authorHandle={item.author.handle} authorDisplayName={item.author.displayName}
authorDisplayName={item.author.displayName} timestamp={item.indexedAt}
timestamp={item.indexedAt} isAuthor={item.author.did === store.me.did}
isAuthor={item.author.did === store.me.did} onCopyPostText={onCopyPostText}
onCopyPostText={onCopyPostText} onDeletePost={onDeletePost}
onDeletePost={onDeletePost} />
/>
) : undefined}
{!isChild && replyHref !== '' && ( {!isChild && replyHref !== '' && (
<View style={[s.flexRow, s.mb2, {alignItems: 'center'}]}> <View style={[s.flexRow, s.mb2, {alignItems: 'center'}]}>
<FontAwesomeIcon <FontAwesomeIcon
@ -289,9 +270,6 @@ const styles = StyleSheet.create({
borderLeftWidth: 2, borderLeftWidth: 2,
borderLeftColor: colors.gray2, borderLeftColor: colors.gray2,
}, },
topReplyLineSmallAvi: {
height: TOP_REPLY_LINE_LENGTH + 10,
},
bottomReplyLine: { bottomReplyLine: {
position: 'absolute', position: 'absolute',
left: 34, left: 34,
@ -300,9 +278,6 @@ const styles = StyleSheet.create({
borderLeftWidth: 2, borderLeftWidth: 2,
borderLeftColor: colors.gray2, borderLeftColor: colors.gray2,
}, },
bottomReplyLineSmallAvi: {
top: 50,
},
includeReason: { includeReason: {
flexDirection: 'row', flexDirection: 'row',
paddingLeft: 60, paddingLeft: 60,