import React from 'react'; import { View, Text, ScrollView, TouchableOpacity, Alert } from 'react-native'; import { useAppTheme } from '@theme'; import { PersonIcon, ChevronRightIcon, ClipboardIcon, StarIcon } from '@icons'; import { useAppDispatch } from '@store'; import { logout } from '@store/commonReducers/auth'; import { useNavigation, CommonActions } from '@react-navigation/native'; import { NativeStackNavigationProp } from '@react-navigation/native-stack'; import { AppStackParamList } from '@navigation/navigationTypes'; import { RouteNames } from '@utils/constants'; import { getStyles } from './profileScreen.styles'; export const ProfileScreen: React.FC = () => { const { colors } = useAppTheme(); const styles = getStyles(colors); const dispatch = useAppDispatch(); const navigation = useNavigation>(); const menuItems = [ { id: 'personal', title: 'Personal Info', icon: }, { id: 'vehicle', title: 'Vehicle Info', icon: }, { id: 'documents', title: 'Documents', icon: , route: RouteNames.Documents }, { id: 'bank', title: 'Bank Details', icon: }, { id: 'emergency', title: 'Emergency Contact', icon: }, { id: 'settings', title: 'App Settings', icon: }, ]; const handleMenuPress = (item: any) => { if (item.route) { navigation.navigate(item.route); } else { Alert.alert('Menu Option', `Viewing ${item.title} section...`); } }; const handleLogout = () => { Alert.alert( 'Logout', 'Are you sure you want to log out of SG Delivery Partner?', [ { text: 'Cancel', style: 'cancel' }, { text: 'Logout', style: 'destructive', onPress: () => { dispatch(logout()); // Reset navigation stack to the Auth Stack navigation.dispatch( CommonActions.reset({ index: 0, routes: [{ name: 'Auth' }], }) ); }, }, ] ); }; return ( {/* Header User Card */} Rahul Kumar 4.8 (128 Trips) ID: DP126478 {/* Profile Menu options */} {menuItems.map((item, idx) => ( handleMenuPress(item)} > {item.icon} {item.title} ))} {/* Logout Button */} Log Out ); }; export default ProfileScreen;