import { router } from "expo-router"; import { Text, TouchableOpacity, View, Image } from "react-native"; import { SafeAreaView } from "react-native-safe-area-context"; import tw from "twrnc"; import Swiper from "react-native-swiper"; import { useRef, useState } from "react"; import { onboarding } from "@/constants"; import CustomButton from "@/components/CustomButton"; const Onboarding = () => { const swiperRef = useRef(null); const [activeIndex, setActiveIndex] = useState(0); const isLastSlide = activeIndex === onboarding.length-1; return ( { router.replace("/(auth)/sign-up"); }} style={tw`w-full flex justify-end items-end p-5 `}> Skip } activeDot={ } onIndexChanged={(index) => setActiveIndex(index)} > {onboarding.map((item) => ( {item.title} {item.description} )) } isLastSlide ? router.replace("/(auth)/sign-up") : swiperRef.current ?. scrollBy(1)} style={tw`w-11/12 mt-10`}/> ) } export default Onboarding;