import React, { useCallback } from 'react'; import { View, Text } from 'react-native'; import Svg, { Circle, Path } from 'react-native-svg'; import { useAppTheme } from '@theme'; import { PrimaryButton } from '@components'; import { useFocusEffect, useNavigation } from '@react-navigation/native'; import { NativeStackNavigationProp } from '@react-navigation/native-stack'; import { OnBoardingParamList } from '@navigation/navigationTypes'; import { RouteNames } from '@utils/constants'; import { getStyles } from './onboardingCompleteScreen.styles'; import { getDashboard } from './thunk'; import { useAppDispatch, useAppSelector } from '@store'; export const OnboardingCompleteScreen: React.FC = () => { const { colors } = useAppTheme(); const navigation = useNavigation>(); const styles = getStyles(colors); const dispatch = useAppDispatch(); useFocusEffect( useCallback(() => { dispatch(getDashboard()); }, [dispatch]), ); const { isKycApproved } = useAppSelector(state => state.onboardingComplete); return ( {/* Premium Success Checkmark Vector */} {/* Checkmark icon */} Onboarding Completed! Welcome to the SG Delivery family! Your account has been successfully verified. You are now ready to go online and start earning. { // If KYC is not yet approved, send user to KYC upload screen. // If KYC is approved, the auth reducer has already updated // user.status to ACTIVE via getDashboard.fulfilled, so the // rootNavigator will automatically swap to AppStack. if (!isKycApproved) { navigation.navigate(RouteNames.Kyc); } }} style={styles.startButton} /> ); };