Skip to content

Commit

Permalink
Fix types again
Browse files Browse the repository at this point in the history
  • Loading branch information
koredefashokun committed Dec 1, 2024
1 parent 56ac87f commit 97a9286
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
5 changes: 3 additions & 2 deletions apps/app/src/components/edit-profile/EditProfileMain.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { FormInput, Screen, TextButton } from '@habiti/components';
import { useNavigation } from '@react-navigation/native';
import { NavigationProp, useNavigation } from '@react-navigation/native';
import React from 'react';
import { useForm } from 'react-hook-form';
import { StyleSheet } from 'react-native';

import { CurrentUserQuery, useEditProfileMutation } from '../../types/api';
import { ProfileStackParamList } from '../../types/navigation';

interface EditProfileMainProps {
currentUser: CurrentUserQuery['currentUser'];
Expand All @@ -16,7 +17,7 @@ interface EditProfileFormValues {
}

const EditProfileMain: React.FC<EditProfileMainProps> = ({ currentUser }) => {
const navigation = useNavigation();
const navigation = useNavigation<NavigationProp<ProfileStackParamList>>();
const [, editProfile] = useEditProfileMutation();

const { control, handleSubmit, formState } = useForm<EditProfileFormValues>({
Expand Down
4 changes: 2 additions & 2 deletions apps/app/src/components/profile/UserCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const UserCard: React.FC = () => {
}

return (
<Pressable onPress={() => navigate('Edit Profile')} style={[styles.card]}>
<Pressable onPress={() => navigate('Profile.Edit')} style={[styles.card]}>
<View
style={[
styles.placeholder,
Expand All @@ -37,7 +37,7 @@ const UserCard: React.FC = () => {
<View style={{ marginLeft: 12 }}>
<Typography weight='medium'>{data.currentUser.name}</Typography>
<Typography variant='secondary' style={styles.phone}>
Edit profile
{data.currentUser.email}
</Typography>
</View>
</Pressable>
Expand Down
6 changes: 5 additions & 1 deletion apps/app/src/navigation/ProfileStack.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ const ProfileStack = () => {
component={Profile}
options={{ headerTitle: 'Profile' }}
/>
<ProfileNavigator.Screen name='Profile.Edit' component={EditProfile} />
<ProfileNavigator.Screen
name='Profile.Edit'
component={EditProfile}
options={{ headerTitle: 'Edit Profile' }}
/>
<ProfileNavigator.Screen
name='Profile.PaymentMethods'
component={PaymentMethods}
Expand Down

0 comments on commit 97a9286

Please sign in to comment.