Merge pull request #2784 from ecency/nt/comment-list-keys

Nt/comment list keys
This commit is contained in:
Feruz M 2023-10-19 14:40:35 +03:00 committed by GitHub
commit 6f77c299a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View File

@ -15,12 +15,12 @@ export const CommentsSection = ({ item, index, revealReplies, ...props }) => {
const _renderComment = (item, index = 0) => {
// animation makes sure there is 100 ms gab between each comment item
const _enteringAnim = SlideInRight.duration(150)
.springify()
.delay(index * 100);
const _enteringAnim = index >= 0
? SlideInRight.duration(150).springify().delay(index * 100)
: undefined
return (
<Animated.View key={item.author + item.permlink} entering={_enteringAnim}>
<Animated.View key={item.author + item.permlink} entering={_enteringAnim}>
<Comment
comment={item}
repliesToggle={toggle}
@ -33,7 +33,7 @@ export const CommentsSection = ({ item, index, revealReplies, ...props }) => {
return (
<>
{_renderComment(item, index)}
{_renderComment(item, -1)}
{toggle && item.repliesThread.map((reply, index) => _renderComment(reply, index))}
</>
);

View File

@ -317,7 +317,7 @@ const PostComments = forwardRef(
contentContainerStyle={styles.listContent}
ListHeaderComponent={_postContentView}
ListEmptyComponent={_renderEmptyContent}
data={isPostLoading ? [] : sortedSections}
data={isPostLoading ? [] : sortedSections.slice()}
onContentSizeChange={_onContentSizeChange}
estimatedItemSize={104}
renderItem={_renderItem}