diff --git a/components/Animation/createCardAnimation.ts b/components/Animation/createCardAnimation.ts new file mode 100644 index 0000000..d366cbb --- /dev/null +++ b/components/Animation/createCardAnimation.ts @@ -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;