From d6339121b738abaa0be568b990bc460755891f10 Mon Sep 17 00:00:00 2001 From: Maria Sanchez Date: Mon, 22 Aug 2022 14:31:47 -0600 Subject: [PATCH] Clean project --- mobile-ui/components/Home.js | 3 - mobile-ui/components/LogIn.js | 7 -- mobile-ui/components/Profile.js | 132 ++++++++++++++++---------------- 3 files changed, 64 insertions(+), 78 deletions(-) diff --git a/mobile-ui/components/Home.js b/mobile-ui/components/Home.js index 0467f85f..d05a12bf 100644 --- a/mobile-ui/components/Home.js +++ b/mobile-ui/components/Home.js @@ -14,7 +14,6 @@ export default function Home() { useEffect(() => { const onRequestCommentsData = async () => { - console.log("CALLED?") setIsRequesting(true); try { @@ -27,8 +26,6 @@ export default function Home() { const response = await jsonResponse.json(); - console.log(response); - setComments(response.message); } catch (error) { diff --git a/mobile-ui/components/LogIn.js b/mobile-ui/components/LogIn.js index 024c7811..97dc08c0 100644 --- a/mobile-ui/components/LogIn.js +++ b/mobile-ui/components/LogIn.js @@ -19,12 +19,6 @@ import { UserContext } from "../context/UserContext"; import { API } from "../environment/api"; const baseURL = `${API.BASE_URL}/user/loginUser`; -const cookies = new Cookies(); - -// const handleChange = (value) => { -// console.log(value); - -// } export default function LogIn({ navigation }) { @@ -39,7 +33,6 @@ export default function LogIn({ navigation }) { const onHandleChange = (name) => (value) => setCredentials(prev => ({ ...prev, [name]: value })) const iniciarSesion = async () => { - console.log(credentials) try { await fetch(baseURL, { diff --git a/mobile-ui/components/Profile.js b/mobile-ui/components/Profile.js index e17e35e0..a84862db 100644 --- a/mobile-ui/components/Profile.js +++ b/mobile-ui/components/Profile.js @@ -1,84 +1,80 @@ -import React from "react"; +import React, { useContext } from "react"; import { - Box, - Heading, - VStack, - FormControl, - Button, - Center, - ScrollView - } from "native-base"; + Box, Button, + Center, FormControl, Heading, ScrollView, VStack +} from "native-base"; - import { View, TextInput, StyleSheet } from "react-native"; +import { StyleSheet, TextInput } from "react-native"; +import { UserContext } from "../context/UserContext"; -export default function Profile({route, navigation}){ +export default function Profile({ navigation }) { - const userData = JSON.parse(JSON.stringify(route.params)); + const userData = useContext(UserContext) console.log(userData.user); - return ( -
+ return ( +
- - - - Bienvenido {userData.user.name} - - - Modifique sus datos - - - - DNI - - - - Nombre - - - - Apellido - - - - Correo electrónico - - - - Contraseña actual - - - - - - - + + + + Bienvenido {userData.user.name} + + + Modifique sus datos + + + + DNI + + + + Nombre + + + + Apellido + + + + Correo electrónico + + + + Contraseña actual + + + + + + + -
- - ) +
+ + ) + - } const styles = StyleSheet.create({ input: { height: 10, - margin:3, + margin: 3, borderWidth: 0.5, padding: 5, flex: 1, @@ -86,9 +82,9 @@ const styles = StyleSheet.create({ paddingRight: 19, paddingBottom: 20, paddingLeft: 0, - marginTop: 6, - marginBottom:6, + marginTop: 6, + marginBottom: 6, borderRadius: 4 } - }) +})