From 4abcd65ccf94e36251142faeabdac42cada490fe Mon Sep 17 00:00:00 2001 From: Hailey Date: Mon, 2 Sep 2024 03:15:31 -0700 Subject: [PATCH] More tweaks to animation (#5082) --- src/lib/custom-animations/CountWheel.tsx | 4 +- src/lib/custom-animations/CountWheel.web.tsx | 5 +- src/lib/custom-animations/LikeIcon.tsx | 48 +++++++++----------- src/lib/custom-animations/LikeIcon.web.tsx | 2 + 4 files changed, 28 insertions(+), 31 deletions(-) diff --git a/src/lib/custom-animations/CountWheel.tsx b/src/lib/custom-animations/CountWheel.tsx index dfa69791..1a867671 100644 --- a/src/lib/custom-animations/CountWheel.tsx +++ b/src/lib/custom-animations/CountWheel.tsx @@ -151,12 +151,12 @@ export function CountWheel({ {formattedCount} - {shouldAnimate ? ( + {shouldAnimate && (likeCount > 1 || !isLiked) ? ( - {shouldAnimate ? ( + {shouldAnimate && (likeCount > 1 || !isLiked) ? ( diff --git a/src/lib/custom-animations/LikeIcon.tsx b/src/lib/custom-animations/LikeIcon.tsx index 06d5c285..f5802ecc 100644 --- a/src/lib/custom-animations/LikeIcon.tsx +++ b/src/lib/custom-animations/LikeIcon.tsx @@ -99,37 +99,33 @@ export function AnimatedLikeIcon({ entering={ shouldAnimate ? circle1Keyframe.duration(300) : undefined } - style={[ - { - position: 'absolute', - backgroundColor: s.likeColor.color, - top: 0, - left: 0, - width: size, - height: size, - zIndex: -1, - pointerEvents: 'none', - borderRadius: size / 2, - }, - ]} + style={{ + position: 'absolute', + backgroundColor: s.likeColor.color, + top: 0, + left: 0, + width: size, + height: size, + zIndex: -1, + pointerEvents: 'none', + borderRadius: size / 2, + }} /> ) : null} diff --git a/src/lib/custom-animations/LikeIcon.web.tsx b/src/lib/custom-animations/LikeIcon.web.tsx index c131dcf6..6dc94c29 100644 --- a/src/lib/custom-animations/LikeIcon.web.tsx +++ b/src/lib/custom-animations/LikeIcon.web.tsx @@ -93,6 +93,7 @@ export function AnimatedLikeIcon({ zIndex: -1, pointerEvents: 'none', borderRadius: size / 2, + opacity: 0, }} />