diff options
author | Hailey <me@haileyok.com> | 2024-09-03 10:55:53 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-03 10:55:53 -0700 |
commit | 0014d4363fa869389d7739ff9e3ffbbb03f5679c (patch) | |
tree | f3afc8371b16ad3c28c0c7d07a4b90479c518fc0 /src/lib/custom-animations/LikeIcon.web.tsx | |
parent | bd42f770b8b5144b6b292495a3193369fc726389 (diff) | |
download | voidsky-0014d4363fa869389d7739ff9e3ffbbb03f5679c.tar.zst |
Only animate the like icon when from an actual toggle (#5096)
Diffstat (limited to 'src/lib/custom-animations/LikeIcon.web.tsx')
-rw-r--r-- | src/lib/custom-animations/LikeIcon.web.tsx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/custom-animations/LikeIcon.web.tsx b/src/lib/custom-animations/LikeIcon.web.tsx index 6dc94c291..ef330bc62 100644 --- a/src/lib/custom-animations/LikeIcon.web.tsx +++ b/src/lib/custom-animations/LikeIcon.web.tsx @@ -41,13 +41,15 @@ const circle2Keyframe = [ export function AnimatedLikeIcon({ isLiked, big, + isToggle, }: { isLiked: boolean big?: boolean + isToggle: boolean }) { const t = useTheme() const size = big ? 22 : 18 - const shouldAnimate = !useReducedMotion() + const shouldAnimate = !useReducedMotion() && isToggle const prevIsLiked = React.useRef(isLiked) const likeIconRef = React.useRef<HTMLDivElement>(null) |