diff --git a/mobile-ui/components/Profile.js b/mobile-ui/components/Profile.js
index 8b656a59..1900c950 100644
--- a/mobile-ui/components/Profile.js
+++ b/mobile-ui/components/Profile.js
@@ -1,22 +1,19 @@
import React, { useContext, useState } from "react";
import { API } from "../environment/api";
import {
- Box, Button,
- Center, FormControl, Heading, ScrollView, VStack
+ Box, Button, FormControl, Heading, ScrollView, VStack
} from "native-base";
-import { StyleSheet, TextInput, useWindowDimensions } from "react-native";
+import { StyleSheet, TextInput} from "react-native";
import { UserContext } from "../context/UserContext";
import { createMaterialTopTabNavigator } from '@react-navigation/material-top-tabs';
import { stringMd5 } from 'react-native-quick-md5';
-
const { Navigator, Screen } = createMaterialTopTabNavigator();
export default function Profile({ navigation }) {
const baseURL = `${API.BASE_URL}/user/updateUser/`
- const [index, setIndex] = useState(0);
- const layout = useWindowDimensions();
+
const userData = useContext(UserContext)
const [name, setName] = useState(userData.user.name);
const [apellido, setApellido] =useState(userData.user.last_name);
@@ -29,6 +26,26 @@ export default function Profile({ navigation }) {
console.log(userData.user);
+
+ const [info, setInfo] = useState({
+ _id: userData.user._id,
+ dni: userData.user.dni,
+ name: "",
+ last_name: "",
+ email: "",
+ community_id: userData.user.community_id,
+ });
+
+ const [infoPassword, setInfoPassword] = useState({
+ _id: userData.user._id,
+ dni: userData.user.dni,
+ password: ""
+
+ });
+
+
+ const onHandleChange = (name) => (value) => setInfo(prev => ({...prev, [name]: value}))
+
const onHandleChangePassword = (value) => {
//console.log(value);
const dpassword = stringMd5(value)
@@ -77,20 +94,20 @@ export default function Profile({ navigation }) {
*/}
Nombre
- setName(value) }/>
+
Apellido
- setApellido(value) } />
+
Correo electrónico
- setEmail(value) }/>
+
-