Skip to content

Commit

Permalink
createCardAnimation
Browse files Browse the repository at this point in the history
  • Loading branch information
Holat committed Aug 23, 2023
1 parent f546c1c commit f3898a4
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions components/Animation/createCardAnimation.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import {
useAnimatedStyle,
useSharedValue,
withTiming,
} from "react-native-reanimated";

const createCardAnimation = (create: boolean) => {
const height = useSharedValue(10.5);
const rStyle = useAnimatedStyle(() => {
height.value = withTiming(create ? 79 : 10.5);
return {
height: `${height.value}%`,
};
});

return rStyle;
};

export default createCardAnimation;

0 comments on commit f3898a4

Please sign in to comment.