Deskripsi: - update package - ui diskusi home - ui event home - ui bar chart home - ui pie chart home - ui divisi home No Issues
32 lines
1.1 KiB
TypeScript
32 lines
1.1 KiB
TypeScript
import Styles from "@/constants/Styles";
|
|
import React from "react";
|
|
import { Dimensions, Text, View } from "react-native";
|
|
import { useSharedValue } from "react-native-reanimated";
|
|
import Carousel, { ICarouselInstance } from "react-native-reanimated-carousel";
|
|
|
|
export default function CaraouselHome() {
|
|
const ref = React.useRef<ICarouselInstance>(null);
|
|
const width = Dimensions.get("window").width;
|
|
const data = [...new Array(6).keys()];
|
|
const progress = useSharedValue<number>(0);
|
|
|
|
return (
|
|
<View style={[Styles.mv15]}>
|
|
<Carousel
|
|
ref={ref}
|
|
width={width}
|
|
height={width / 2.5}
|
|
data={data}
|
|
loop={true}
|
|
autoPlay={true}
|
|
autoPlayInterval={5000}
|
|
onProgressChange={progress}
|
|
renderItem={({ index }) => (
|
|
<View style={Styles.caraoselContent} >
|
|
<Text style={{ textAlign: "center", color: "white", fontWeight: 'bold' }}>BANNER DARMASABA</Text>
|
|
</View>
|
|
)}
|
|
/>
|
|
</View>
|
|
)
|
|
} |