Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import PagerView from 'react-native-pager-view';
- import React, {useRef, useState} from 'react';
- import {StyleSheet, Text, TouchableOpacity, View} from 'react-native';
- import {Formik} from 'formik';
- import GetStarted from './GetStarted';
- import Registration from './Registration';
- import Verification from './Verification';
- import Theme from '../../utils/theme';
- import {SafeAreaView} from 'react-native-safe-area-context';
- import {registerSchema} from '../../models/registerSchema';
- export const Onboarding: React.FunctionComponent = () => {
- const pagerRef: React.LegacyRef<PagerView> = useRef(null);
- const onPageChange = (page: number) => {
- pagerRef.current?.setPage(page);
- };
- return (
- <SafeAreaView style={styles.container}>
- <Formik
- initialValues={{}}
- validationSchema={registerSchema}
- onSubmit={values => console.log(values)}>
- <PagerView style={{flex: 1}} ref={pagerRef} scrollEnabled={false}>
- <View key="1">
- <GetStarted onPageChange={onPageChange} />
- </View>
- <View key="2">
- <Registration onPageChange={onPageChange} />
- </View>
- <View key="3">
- <Verification onPageChange={onPageChange} />
- </View>
- </PagerView>
- </Formik>
- </SafeAreaView>
- );
- };
- const styles = StyleSheet.create({
- container: {
- flex: 1,
- backgroundColor: Theme.colors.lightGray,
- },
- });
Add Comment
Please, Sign In to add comment