37 lines
1.2 KiB
TypeScript
37 lines
1.2 KiB
TypeScript
import React from 'react';
|
|
import { View, Text } from 'react-native';
|
|
import { getStyles } from './onboardingCompleteScreen.styles';
|
|
import { PrimaryButton } from '@components';
|
|
import { useAppTheme } from '@theme';
|
|
|
|
import { useAppDispatch } from '@store';
|
|
import { completeOnboarding } from '@store/commonreducers/auth';
|
|
|
|
export const OnboardingCompleteScreen: React.FC = () => {
|
|
const { colors } = useAppTheme();
|
|
const styles = getStyles(colors);
|
|
const dispatch = useAppDispatch();
|
|
|
|
const handleExplore = () => {
|
|
// Dispatching completeOnboarding sets user.status = 'ACTIVE' in Redux.
|
|
// RootNavigator watches this value and automatically swaps OnboardingStack
|
|
// → AppStack. No direct navigation call needed or possible here.
|
|
dispatch(completeOnboarding());
|
|
};
|
|
|
|
return (
|
|
<View style={styles.container}>
|
|
<View style={styles.content}>
|
|
<Text style={styles.icon}>🎉</Text>
|
|
<Text style={styles.title}>All Set!</Text>
|
|
<Text style={styles.subtitle}>
|
|
You're ready to explore and order from the best providers near you.
|
|
</Text>
|
|
</View>
|
|
<View style={styles.footer}>
|
|
<PrimaryButton title="Explore Now" onPress={handleExplore} />
|
|
</View>
|
|
</View>
|
|
);
|
|
};
|