Skip to content

Commit

Permalink
[#19351] fix: use animation worklet
Browse files Browse the repository at this point in the history
  • Loading branch information
mohsen-ghafouri committed Apr 3, 2024
1 parent 6a7783d commit 8bbe9f9
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/js/worklets/profile_header.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { useAnimatedStyle, withTiming } from 'react-native-reanimated';

export function profileHeaderAnimation(scrollY, threshold, topBarHeight) {
return useAnimatedStyle(() => {
'worklet';
const opacity = scrollY.value < threshold ? withTiming(0) : withTiming(1);
const translateY = scrollY.value < threshold ? withTiming(topBarHeight) : withTiming(0);

Expand Down

0 comments on commit 8bbe9f9

Please sign in to comment.