diff --git a/examples/common_expo/app/(app)/_layout.tsx b/examples/common_expo/app/(app)/_layout.tsx index 01dfab2..24d8b93 100644 --- a/examples/common_expo/app/(app)/_layout.tsx +++ b/examples/common_expo/app/(app)/_layout.tsx @@ -16,7 +16,7 @@ export default function AppLayout() { } if (!session) { - return ; + return ; } return ( diff --git a/examples/common_expo/app/onboarding.tsx b/examples/common_expo/app/onboarding.tsx new file mode 100644 index 0000000..868b4c9 --- /dev/null +++ b/examples/common_expo/app/onboarding.tsx @@ -0,0 +1,74 @@ +import Animated, { + useAnimatedRef, + useAnimatedScrollHandler, + useSharedValue, +} from 'react-native-reanimated'; +import { SafeAreaView, StyleSheet, View } from 'react-native'; + +import { + NextButton, + OnboardingListItem, + OnboardingItem, + OnboardingWrapper, + Pagination, +} from '@/components/Onboarding'; + +const items: OnboardingItem[] = [ + { text: 'First' }, + { text: 'Second' }, + { text: 'Third' }, +]; + +export default function Onboarding() { + const offsetX = useSharedValue(0); + const flatListIndex = useSharedValue(0); + const flatListRef = useAnimatedRef>(); + + const handleOnScroll = useAnimatedScrollHandler({ + onScroll: (event) => { + offsetX.value = event.contentOffset.x; + }, + }); + + return ( + + + index.toString()} + renderItem={({ item, index }) => ( + + )} + onViewableItemsChanged={({ viewableItems }) => { + flatListIndex.value = viewableItems[0].index ?? 0; + }} + onScroll={handleOnScroll} + bounces={false} + showsHorizontalScrollIndicator={false} + horizontal + pagingEnabled + /> + + + + + + + ); +} + +const styles = StyleSheet.create({ + container: { + flex: 1, + }, + bottomPanel: { + flexDirection: 'row', + justifyContent: 'space-between', + paddingHorizontal: 24, + }, +}); diff --git a/examples/common_expo/app/sign-in.tsx b/examples/common_expo/app/sign-in.tsx index 8db7645..d3e9531 100644 --- a/examples/common_expo/app/sign-in.tsx +++ b/examples/common_expo/app/sign-in.tsx @@ -73,7 +73,7 @@ export default function SignIn() {