react-native-momentum-carousel
Version:
A React Native carousel component enables smooth and interactive image or content sliders with swiping capabilities. Ideal for showcasing multiple items or images in a compact space, this carousel can be customized with features like infinite scrolling, p
22 lines (20 loc) • 652 B
text/typescript
import { CarouselMomentumAnimationType } from './CarouselMomentum';
import { ItemCarouselProps } from './ItemCarousel';
import {
useLayoutStackAnimation,
useLayoutDefaultAnimation,
useLayoutTinderAnimation,
} from './useLayoutAnimation';
export function useLayoutConfig(data: ItemCarouselProps) {
const stack = useLayoutStackAnimation(data);
const sample = useLayoutDefaultAnimation(data);
const tinder = useLayoutTinderAnimation(data);
switch (data.animation) {
case CarouselMomentumAnimationType.Stack:
return stack;
case CarouselMomentumAnimationType.Tinder:
return tinder;
default:
return sample;
}
}