-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e86890e
commit a350f68
Showing
5 changed files
with
54 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,19 @@ | ||
import React from 'react'; | ||
|
||
import {Screen, Text} from '@components'; | ||
import {useUserGetById} from '@domain'; | ||
|
||
import {Screen} from '@components'; | ||
import {AppScreenProps} from '@routes'; | ||
|
||
export function EditProfileScreen({}: AppScreenProps<'EditProfileScreen'>) { | ||
import {EditProfileHeader} from './components/EditProfileHeader'; | ||
|
||
export function EditProfileScreen({ | ||
route, | ||
}: AppScreenProps<'EditProfileScreen'>) { | ||
const {user} = useUserGetById(route.params.userId); | ||
return ( | ||
<Screen canGoBack scrollable title="Editar Perfil"> | ||
<Text preset="headingSmall">Editar Perfil</Text> | ||
<EditProfileHeader user={user} /> | ||
</Screen> | ||
); | ||
} |
32 changes: 32 additions & 0 deletions
32
src/screens/app/EditProfileScreen/components/EditProfileHeader.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import React from 'react'; | ||
import {Pressable} from 'react-native'; | ||
|
||
import {User} from '@domain'; | ||
|
||
import {Box, ProfileAvatar, Text} from '@components'; | ||
|
||
type Props = { | ||
user?: User; | ||
}; | ||
export function EditProfileHeader({user}: Props) { | ||
if (!user) { | ||
return null; | ||
} | ||
|
||
function navigateToPhoto() { | ||
//TODO: add navigate to edit photo | ||
console.log('navigate to edit photo '); | ||
} | ||
|
||
return ( | ||
<Box flexDirection="row" alignItems="center"> | ||
<ProfileAvatar imageURL={user?.profileUrl} size={64} borderRadius={24} /> | ||
|
||
<Pressable hitSlop={12} onPress={navigateToPhoto}> | ||
<Text preset="paragraphMedium" color="primary" bold ml="s16"> | ||
Alterar foto | ||
</Text> | ||
</Pressable> | ||
</Box> | ||
); | ||
} |