2022-08-22 06:09:51 +00:00
|
|
|
import React from "react";
|
|
|
|
|
|
|
|
import {
|
|
|
|
Box,
|
|
|
|
Heading,
|
|
|
|
VStack,
|
2022-08-22 06:52:20 +00:00
|
|
|
FormControl,
|
2022-08-22 06:09:51 +00:00
|
|
|
Button,
|
2022-08-22 06:52:20 +00:00
|
|
|
Center,
|
|
|
|
ScrollView
|
2022-08-22 06:09:51 +00:00
|
|
|
} from "native-base";
|
|
|
|
|
2022-08-22 06:52:20 +00:00
|
|
|
import { View, TextInput, StyleSheet } from "react-native";
|
2022-08-22 06:09:51 +00:00
|
|
|
|
2022-08-22 06:52:20 +00:00
|
|
|
export default function ProfileGuarda({route, navigation}){
|
|
|
|
|
|
|
|
const userData = JSON.parse(JSON.stringify(route.params));
|
|
|
|
|
|
|
|
console.log(userData.user);
|
2022-08-22 06:09:51 +00:00
|
|
|
return (
|
|
|
|
<Center>
|
2022-08-22 06:52:20 +00:00
|
|
|
|
|
|
|
<ScrollView width='100%' h='550' ml='36' _contentContainerStyle={{
|
|
|
|
px: "20px",
|
|
|
|
mb: "4",
|
|
|
|
minW: "72"
|
|
|
|
}}>
|
2022-08-22 06:09:51 +00:00
|
|
|
<Box safeArea p="2" w="90%" maxW="290" py="8">
|
|
|
|
<Heading size="lg" color="coolGray.800" _dark={{
|
|
|
|
color: "warmGray.50"
|
|
|
|
}} fontWeight="semibold">
|
2022-08-22 06:52:20 +00:00
|
|
|
Bienvenido {userData.user.name}
|
2022-08-22 06:09:51 +00:00
|
|
|
</Heading>
|
|
|
|
<Heading mt="1" color="coolGray.600" _dark={{
|
|
|
|
color: "warmGray.200"
|
|
|
|
}} fontWeight="medium" size="xs">
|
|
|
|
Modifique sus datos
|
|
|
|
</Heading>
|
|
|
|
<VStack space={3} mt="5">
|
2022-08-22 06:52:20 +00:00
|
|
|
<FormControl>
|
|
|
|
<FormControl.Label>DNI</FormControl.Label>
|
|
|
|
<TextInput type="text" defaultValue={userData.user.dni} editable='false'/>
|
|
|
|
</FormControl>
|
2022-08-22 06:09:51 +00:00
|
|
|
<FormControl>
|
|
|
|
<FormControl.Label>Nombre</FormControl.Label>
|
2022-08-22 06:52:20 +00:00
|
|
|
<TextInput style={styles.input} type="text" defaultValue={userData.user.name}/>
|
2022-08-22 06:09:51 +00:00
|
|
|
</FormControl>
|
|
|
|
<FormControl>
|
2022-08-22 06:52:20 +00:00
|
|
|
<FormControl.Label>Apellido</FormControl.Label>
|
|
|
|
<TextInput style={styles.input} type="text"defaultValue={userData.user.last_name} />
|
2022-08-22 06:09:51 +00:00
|
|
|
</FormControl>
|
|
|
|
<FormControl>
|
2022-08-22 06:52:20 +00:00
|
|
|
<FormControl.Label>Correo electrónico</FormControl.Label>
|
|
|
|
<TextInput style={styles.input} type="text" defaultValue={userData.user.email}/>
|
2022-08-22 06:09:51 +00:00
|
|
|
</FormControl>
|
|
|
|
<FormControl>
|
|
|
|
<FormControl.Label>Contraseña actual</FormControl.Label>
|
2022-08-22 06:52:20 +00:00
|
|
|
<TextInput style={styles.input} type="password" defaultValue=""/>
|
2022-08-22 06:09:51 +00:00
|
|
|
</FormControl>
|
|
|
|
|
|
|
|
<Button mt="2" backgroundColor="orange.300">
|
|
|
|
Actualizar
|
|
|
|
</Button>
|
|
|
|
<Button mt="6" colorScheme="error" onPress={() => navigation.navigate('Inicio')}>
|
|
|
|
Cerrar sesión
|
|
|
|
</Button>
|
|
|
|
</VStack>
|
|
|
|
</Box>
|
2022-08-22 06:52:20 +00:00
|
|
|
|
|
|
|
</ScrollView>
|
2022-08-22 06:09:51 +00:00
|
|
|
</Center>
|
|
|
|
|
|
|
|
)
|
2022-08-22 06:52:20 +00:00
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
const styles = StyleSheet.create({
|
|
|
|
input: {
|
|
|
|
height: 10,
|
|
|
|
margin:3,
|
|
|
|
borderWidth: 0.5,
|
|
|
|
padding: 5,
|
|
|
|
flex: 1,
|
|
|
|
paddingTop: 9,
|
|
|
|
paddingRight: 19,
|
|
|
|
paddingBottom: 20,
|
|
|
|
paddingLeft: 0,
|
|
|
|
marginTop: 6,
|
|
|
|
marginBottom:6,
|
|
|
|
borderRadius: 4
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|