From 0a99669af6b9cfa9646b9351fb8140bd0381474c Mon Sep 17 00:00:00 2001 From: xmflsct Date: Fri, 14 Jul 2023 22:56:08 +0200 Subject: [PATCH] Update index.tsx --- src/components/Timeline/index.tsx | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/components/Timeline/index.tsx b/src/components/Timeline/index.tsx index 0cddb3bb..c47f11e5 100644 --- a/src/components/Timeline/index.tsx +++ b/src/components/Timeline/index.tsx @@ -136,16 +136,23 @@ const Timeline: React.FC = ({ transform: [{ translateY: fetchedNoticeTop.value }] })) + const refetchedNoticeBottom = useDerivedValue(() => { + if (firstLoad.value) { + return withSequence( + withTiming(0), + withDelay( + 3000, + withTiming(fetchedNoticeHeight.value + 32, { easing: Easing.out(Easing.ease) }) + ) + ) + } else { + return fetchedNoticeHeight.value + 32 + } + }, []) const refetchedNoticeAnimate = useAnimatedStyle(() => ({ transform: [ { - translateY: withSequence( - withTiming(0), - withDelay( - 3000, - withTiming(fetchedNoticeHeight.value + 32, { easing: Easing.out(Easing.ease) }) - ) - ) + translateY: refetchedNoticeBottom.value } ] }))