import React, { useState } from 'react'; import { View, Text, KeyboardAvoidingView, Platform, ScrollView, TouchableOpacity, } from 'react-native'; import { useNavigation } from '@react-navigation/native'; import { StackNavigationProp } from '@react-navigation/stack'; import { getStyles } from './completeProfileScreen.styles'; import { CustomInput, PrimaryButton } from '@components'; import { useAppTheme } from '@theme'; import { AuthStackParamList } from '../../../navigation/authStack'; import { useAppDispatch } from '@store'; import { saveProfileData } from './reducer'; import { OnboardingStackParamList } from '@navigation/onboardingStack'; type NavProp = StackNavigationProp< OnboardingStackParamList, 'CompleteProfileScreen' >; const LOCATION_LABELS = ['Home', 'Work', 'Other']; export const CompleteProfileScreen: React.FC = () => { const { colors } = useAppTheme(); const styles = getStyles(colors); const navigation = useNavigation(); const dispatch = useAppDispatch(); const [name, setName] = useState(''); const [email, setEmail] = useState(''); const [gender, setGender] = useState<'MALE' | 'FEMALE' | 'OTHER'>('MALE'); const [addressLine1, setAddressLine1] = useState(''); const [houseNumber, setHouseNumber] = useState(''); const [landmark, setLandmark] = useState(''); const [city, setCity] = useState(''); const [state, setState] = useState(''); const [postalCode, setPostalCode] = useState(''); const [addressPhone, setAddressPhone] = useState(''); const [selectedLabel, setSelectedLabel] = useState('Home'); const handleSave = () => { dispatch( saveProfileData({ name, email, gender, addressLine1, houseNumber, landmark, city, state, postalCode, addressPhone, addressLabel: selectedLabel, }), ); navigation.navigate('PreferencesScreen'); }; return ( Complete Profile Tell us about yourself {/* Personal Information */} {/* Gender */} Gender {['MALE', 'FEMALE', 'OTHER'].map(item => ( setGender(item as 'MALE' | 'FEMALE' | 'OTHER')} > {item.charAt(0) + item.slice(1).toLowerCase()} ))} {/* Address */} {/* Location Label */} Location Label {LOCATION_LABELS.map(label => ( setSelectedLabel(label)} > {label} ))} ); };