fix thread double border (#1251)

This commit is contained in:
Eric Bailey 2023-08-22 12:49:03 -05:00 committed by GitHub
parent 09a445d804
commit 13c11801b9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 7 deletions

View file

@ -156,7 +156,7 @@ export const PostThread = observer(function PostThread({
}, [navigation])
const renderItem = React.useCallback(
({item}: {item: YieldedItem}) => {
({item, index}: {item: YieldedItem; index: number}) => {
if (item === PARENT_SPINNER) {
return (
<View style={styles.parentSpinner}>
@ -205,11 +205,20 @@ export const PostThread = observer(function PostThread({
</View>
)
} else if (item instanceof PostThreadItemModel) {
return <PostThreadItem item={item} onPostReply={onRefresh} />
const prev = (
index - 1 >= 0 ? posts[index - 1] : undefined
) as PostThreadItemModel
return (
<PostThreadItem
item={item}
onPostReply={onRefresh}
hasPrecedingItem={prev?._showChildReplyLine}
/>
)
}
return <></>
},
[onRefresh, onPressReply, pal],
[onRefresh, onPressReply, pal, posts],
)
// loading