disabled comment reveal animation for first layers of comments

This commit is contained in:
noumantahir 2023-10-19 16:28:24 +05:00
parent 962447bf20
commit a785b0f2b3

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))}
</>
);