Clean project
This commit is contained in:
parent
ca6f1d1496
commit
d6339121b7
|
@ -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) {
|
||||
|
|
|
@ -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, {
|
||||
|
|
|
@ -1,20 +1,16 @@
|
|||
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 (
|
||||
|
@ -39,23 +35,23 @@ export default function Profile({route, navigation}){
|
|||
<VStack space={3} mt="5">
|
||||
<FormControl>
|
||||
<FormControl.Label>DNI</FormControl.Label>
|
||||
<TextInput type="text" defaultValue={userData.user.dni} editable='false'/>
|
||||
<TextInput type="text" defaultValue={userData.user.dni} editable='false' />
|
||||
</FormControl>
|
||||
<FormControl>
|
||||
<FormControl.Label>Nombre</FormControl.Label>
|
||||
<TextInput style={styles.input} type="text" defaultValue={userData.user.name}/>
|
||||
<TextInput style={styles.input} type="text" defaultValue={userData.user.name} />
|
||||
</FormControl>
|
||||
<FormControl>
|
||||
<FormControl.Label>Apellido</FormControl.Label>
|
||||
<TextInput style={styles.input} type="text"defaultValue={userData.user.last_name} />
|
||||
<TextInput style={styles.input} type="text" defaultValue={userData.user.last_name} />
|
||||
</FormControl>
|
||||
<FormControl>
|
||||
<FormControl.Label>Correo electrónico</FormControl.Label>
|
||||
<TextInput style={styles.input} type="text" defaultValue={userData.user.email}/>
|
||||
<TextInput style={styles.input} type="text" defaultValue={userData.user.email} />
|
||||
</FormControl>
|
||||
<FormControl>
|
||||
<FormControl.Label>Contraseña actual</FormControl.Label>
|
||||
<TextInput style={styles.input} type="password" defaultValue=""/>
|
||||
<TextInput style={styles.input} type="password" defaultValue="" />
|
||||
</FormControl>
|
||||
|
||||
<Button mt="2" backgroundColor="orange.300">
|
||||
|
@ -78,7 +74,7 @@ export default function Profile({route, navigation}){
|
|||
const styles = StyleSheet.create({
|
||||
input: {
|
||||
height: 10,
|
||||
margin:3,
|
||||
margin: 3,
|
||||
borderWidth: 0.5,
|
||||
padding: 5,
|
||||
flex: 1,
|
||||
|
@ -87,8 +83,8 @@ const styles = StyleSheet.create({
|
|||
paddingBottom: 20,
|
||||
paddingLeft: 0,
|
||||
marginTop: 6,
|
||||
marginBottom:6,
|
||||
marginBottom: 6,
|
||||
borderRadius: 4
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
|
|
Loading…
Reference in New Issue