diff --git a/src/Splash.tsx b/src/Splash.tsx index 6e4f86ace4..4a4dea831a 100644 --- a/src/Splash.tsx +++ b/src/Splash.tsx @@ -124,14 +124,14 @@ export function Splash(props: React.PropsWithChildren) { if (isReady) { SplashScreen.hideAsync() .then(() => { - intro.set(() => + intro.set( withTiming( 1, {duration: 400, easing: Easing.out(Easing.cubic)}, () => { 'worklet' // set these values to check animation at specific point - outroLogo.set(() => + outroLogo.set( withTiming( 1, {duration: 1200, easing: Easing.in(Easing.cubic)}, @@ -140,13 +140,13 @@ export function Splash(props: React.PropsWithChildren) { }, ), ) - outroApp.set(() => + outroApp.set( withTiming(1, { duration: 1200, easing: Easing.inOut(Easing.cubic), }), ) - outroAppOpacity.set(() => + outroAppOpacity.set( withTiming(1, { duration: 1200, easing: Easing.in(Easing.cubic), diff --git a/src/components/AvatarBubbles.tsx b/src/components/AvatarBubbles.tsx index 685b96c57d..4c051bfd4a 100644 --- a/src/components/AvatarBubbles.tsx +++ b/src/components/AvatarBubbles.tsx @@ -72,7 +72,7 @@ export function AvatarBubbles({ if (!animate) return const animateBubble = (p: SharedValue, i: number) => { p.set(0) - p.set(() => + p.set( withDelay( 500 + i * 100, withTiming(1, { diff --git a/src/components/Lightbox/pager/ImagePager.tsx b/src/components/Lightbox/pager/ImagePager.tsx index 78abbf9f77..28c75be2cc 100644 --- a/src/components/Lightbox/pager/ImagePager.tsx +++ b/src/components/Lightbox/pager/ImagePager.tsx @@ -119,16 +119,12 @@ export default function ImageViewRoot({ // https://github.com/software-mansion/react-native-reanimated/issues/6677 rAF_FIXED(() => { - openProgress.set(() => - isAnimated ? withClampedSpring(1, SLOW_SPRING) : 1, - ) + openProgress.set(isAnimated ? withClampedSpring(1, SLOW_SPRING) : 1) }) return () => { // https://github.com/software-mansion/react-native-reanimated/issues/6677 rAF_FIXED(() => { - openProgress.set(() => - isAnimated ? withClampedSpring(0, SLOW_SPRING) : 0, - ) + openProgress.set(isAnimated ? withClampedSpring(0, SLOW_SPRING) : 0) }) } }, [nextLightbox, openProgress, thumbRects]) @@ -591,25 +587,23 @@ function LightboxImage({ // This is a bug in Reanimated, but for now we'll work around it like this. dismissSwipeTranslateY.set(1) } - dismissSwipeTranslateY.set(() => { - 'worklet' - return withDecay({ + dismissSwipeTranslateY.set( + withDecay({ velocity: e.velocityY, velocityFactor: Math.max(3500 / Math.abs(e.velocityY), 1), // Speed up if it's too slow. deceleration: 1, // Danger! This relies on the reaction below stopping it. reduceMotion: ReduceMotion.Never, // If this animation doesn't run, the image gets stuck - therefore override Reduce Motion - }) - }) + }), + ) } else { - dismissSwipeTranslateY.set(() => { - 'worklet' - return withSpring(0, { + dismissSwipeTranslateY.set( + withSpring(0, { stiffness: 700, damping: 50, mass: 1, reduceMotion: ReduceMotion.Never, - }) - }) + }), + ) } }) diff --git a/src/components/Loader.tsx b/src/components/Loader.tsx index 1d03b2c26e..9c98c120dd 100644 --- a/src/components/Loader.tsx +++ b/src/components/Loader.tsx @@ -21,7 +21,7 @@ export function Loader(props: Props) { })) useEffect(() => { - rotation.set(() => + rotation.set( withRepeat(withTiming(360, {duration: 500, easing: Easing.linear}), -1), ) }, [rotation]) diff --git a/src/components/ProgressGuide/Toast.tsx b/src/components/ProgressGuide/Toast.tsx index 961f3ed231..79c08cedb0 100644 --- a/src/components/ProgressGuide/Toast.tsx +++ b/src/components/ProgressGuide/Toast.tsx @@ -62,7 +62,7 @@ export const ProgressGuideToast = forwardRef< // animate the opacity then set isOpen to false when done const setIsntOpen = () => setIsOpen(false) - opacity.set(() => + opacity.set( withTiming( 0, { @@ -81,7 +81,7 @@ export const ProgressGuideToast = forwardRef< // animate the vertical translation, the opacity, and the checkmark const playCheckmark = () => animatedCheckRef.current?.play() opacity.set(0) - opacity.set(() => + opacity.set( withTiming( 1, { @@ -92,7 +92,7 @@ export const ProgressGuideToast = forwardRef< ), ) translateY.set(0) - translateY.set(() => + translateY.set( withTiming(insets.top + 10, { duration: 500, easing: Easing.out(Easing.cubic), diff --git a/src/components/anim/AnimatedCheck.tsx b/src/components/anim/AnimatedCheck.tsx index e58ca9aff6..6709b49a5f 100644 --- a/src/components/anim/AnimatedCheck.tsx +++ b/src/components/anim/AnimatedCheck.tsx @@ -41,10 +41,8 @@ export const AnimatedCheck = forwardRef( circleAnim.set(0) checkAnim.set(0) - circleAnim.set(() => - withTiming(1, {duration: 500, easing: Easing.linear}), - ) - checkAnim.set(() => + circleAnim.set(withTiming(1, {duration: 500, easing: Easing.linear})) + checkAnim.set( withDelay( 500, withTiming(1, {duration: 300, easing: Easing.linear}, cb), diff --git a/src/components/dms/NewMessagesPill.tsx b/src/components/dms/NewMessagesPill.tsx index 049dcac26a..fab463bacd 100644 --- a/src/components/dms/NewMessagesPill.tsx +++ b/src/components/dms/NewMessagesPill.tsx @@ -32,12 +32,12 @@ export function NewMessagesPill({ const onPressIn = useCallback(() => { if (IS_WEB) return - scale.set(() => withTiming(1.075, {duration: 100})) + scale.set(withTiming(1.075, {duration: 100})) }, [scale]) const onPressOut = useCallback(() => { if (IS_WEB) return - scale.set(() => withTiming(1, {duration: 100})) + scale.set(withTiming(1, {duration: 100})) }, [scale]) const onPress = useCallback(() => { diff --git a/src/components/dms/SwipeToReply.tsx b/src/components/dms/SwipeToReply.tsx index 7cdd256aa9..dbdbf9fd65 100644 --- a/src/components/dms/SwipeToReply.tsx +++ b/src/components/dms/SwipeToReply.tsx @@ -78,7 +78,7 @@ export function SwipeToReply({ const runPop = () => { 'worklet' if (isReducedMotion) return - iconScale.set(() => + iconScale.set( withSequence( withTiming(1.2, {duration: 175}), withTiming(1, {duration: 100}), diff --git a/src/lib/custom-animations/GestureActionView.tsx b/src/lib/custom-animations/GestureActionView.tsx index de4dd5d0fa..6f3efcf4bd 100644 --- a/src/lib/custom-animations/GestureActionView.tsx +++ b/src/lib/custom-animations/GestureActionView.tsx @@ -63,7 +63,7 @@ export function GestureActionView({ return } - iconScale.set(() => + iconScale.set( withSequence( withTiming(1.2, {duration: 175}), withTiming(1, {duration: 100}), @@ -205,7 +205,7 @@ export function GestureActionView({ scheduleOnRN(actions.rightFirst.action) } } - transX.set(() => withTiming(0, {duration: 200})) + transX.set(withTiming(0, {duration: 200})) hitFirst.set(false) hitSecond.set(false) isActive.set(false) diff --git a/src/lib/custom-animations/PressableScale.tsx b/src/lib/custom-animations/PressableScale.tsx index acf87a0dc8..df9341d957 100644 --- a/src/lib/custom-animations/PressableScale.tsx +++ b/src/lib/custom-animations/PressableScale.tsx @@ -45,14 +45,14 @@ export function PressableScale({ onPressIn(e) } cancelAnimation(scale) - scale.set(() => withTiming(targetScale, {duration: 100})) + scale.set(withTiming(targetScale, {duration: 100})) }} onPressOut={e => { if (onPressOut) { onPressOut(e) } cancelAnimation(scale) - scale.set(() => withTiming(1, {duration: 100})) + scale.set(withTiming(1, {duration: 100})) }} style={[!reducedMotion && animatedStyle, style]} {...rest}> diff --git a/src/state/shell/minimal-mode.tsx b/src/state/shell/minimal-mode.tsx index 2309b6fa1b..a592b47767 100644 --- a/src/state/shell/minimal-mode.tsx +++ b/src/state/shell/minimal-mode.tsx @@ -33,7 +33,7 @@ export function Provider({children}: React.PropsWithChildren<{}>) { const setModeWorklet = useCallback( (v: boolean) => { 'worklet' - footerMode.set(() => + footerMode.set( withSpring(v ? 1 : 0, { ...Reanimated3DefaultSpringConfig, overshootClamping: true, diff --git a/src/view/com/util/MainScrollProvider.tsx b/src/view/com/util/MainScrollProvider.tsx index ccab7cb992..c35df1c8c7 100644 --- a/src/view/com/util/MainScrollProvider.tsx +++ b/src/view/com/util/MainScrollProvider.tsx @@ -104,7 +104,7 @@ export function MainScrollProvider({children}: {children: React.ReactNode}) { const setMode = useCallback( (v: boolean) => { 'worklet' - headerMode.set(() => + headerMode.set( withSpring(v ? 1 : 0, { ...Reanimated3DefaultSpringConfig, overshootClamping: true, diff --git a/src/view/screens/Home.tsx b/src/view/screens/Home.tsx index d3495bbd04..2303b69268 100644 --- a/src/view/screens/Home.tsx +++ b/src/view/screens/Home.tsx @@ -150,7 +150,7 @@ function HomeScreenReady({ const headerMode = useHomeHeaderMode() const showHeader = useCallback(() => { 'worklet' - headerMode.set(() => + headerMode.set( withSpring(0, { ...Reanimated3DefaultSpringConfig, overshootClamping: true,