feat: call image picker

This commit is contained in:
Vinicius Souza 2024-10-28 09:41:01 -03:00
parent 56c8df4222
commit d96270773b

View file

@ -1,5 +1,6 @@
import { ScrollView, TouchableOpacity } from 'react-native';
import { Center, Heading, Text, VStack } from '@gluestack-ui/themed';
import * as ImagePicker from 'expo-image-picker';
import { Button } from '@components/Button';
import { Input } from '@components/Input';
@ -7,6 +8,10 @@ import { ScreenHeader } from '@components/ScreenHeader';
import { UserPhoto } from '@components/UserPhoto';
export function Profile() {
async function handleUserPhotoSelection() {
await ImagePicker.launchImageLibraryAsync();
}
return (
<VStack flex={1}>
<ScreenHeader title="Perfil" />
@ -19,7 +24,7 @@ export function Profile() {
size="xl"
/>
<TouchableOpacity>
<TouchableOpacity onPress={handleUserPhotoSelection}>
<Text color="$green500" fontFamily="$heading" fontSize="$md" mt="$2" mb="$8">
Alterar foto
</Text>