-
Notifications
You must be signed in to change notification settings - Fork 47
Open
Description
export const BanerSwiper = () => {
const BannerWidth = Dimensions.get('window').width;
const BannerHeight = 260;
const [images, set_images] = useState(Array)
useEffect(() => {
set_images([
"https://smapse.com/storage/2018/03/admiral-farragut-academy-sport.jpg",
"https://smapse.com/storage/2018/03/admiral-farragut.jpg",
"https://smapse.com/storage/2018/03/akademiya-admiral-farragut.jpg"
])
}, [])
console.log('images:', images)
const renderPage = (image: string, index: React.Key | null | undefined) => {
return (
<View key={index}>
<Image style={{ width: BannerWidth, height: BannerHeight }} source={{ uri: image }} />
</View>
);
}
return (
<View style={styles.container}>
<Carousel
autoplay
autoplayTimeout={5000}
loop
index={0}
pageSize={BannerWidth}
>
{images.map((image, index) => { return (renderPage(image, index)) })}
</Carousel>
</View>
);
}
Metadata
Metadata
Assignees
Labels
No labels