From d1976e988b26cb8044f7715a24a5e5f67c5a6569 Mon Sep 17 00:00:00 2001 From: Maria Sanchez Date: Mon, 22 Aug 2022 22:20:07 -0600 Subject: [PATCH] fix css and reservas --- mobile-ui/components/AgregarInvitados.js | 10 +-- mobile-ui/components/AreaComun.js | 99 ++++++++++++++++++---- mobile-ui/components/LogIn.js | 2 +- mobile-ui/components/ReservasCard/index.js | 9 +- 4 files changed, 98 insertions(+), 22 deletions(-) diff --git a/mobile-ui/components/AgregarInvitados.js b/mobile-ui/components/AgregarInvitados.js index afe09210..e8c80b66 100644 --- a/mobile-ui/components/AgregarInvitados.js +++ b/mobile-ui/components/AgregarInvitados.js @@ -76,23 +76,23 @@ export default function AgregarInvitados({ navigation }) { Registre el invitado que desee - + Nombre setName(value)}/> - + Apellido setApellido(value)}/> - + Identificación setDNI(value)}/> - + Teléfono setPhone(value)} /> - diff --git a/mobile-ui/components/AreaComun.js b/mobile-ui/components/AreaComun.js index ddd29bd2..c6b3a71c 100644 --- a/mobile-ui/components/AreaComun.js +++ b/mobile-ui/components/AreaComun.js @@ -1,4 +1,4 @@ -import React from "react"; +import React, {useContext, useEffect, useState} from "react"; import { Box, @@ -7,11 +7,54 @@ import { FormControl, Input, Button, - Center + Center, + Select, CheckIcon } from "native-base"; +import { UserContext } from "../context/UserContext"; +import { API } from "../environment/api"; export default function AreaComun({navigation}){ + const { user } = useContext(UserContext) + const [service, setService] = useState(""); + const [areas, setAreas] = useState([]) + const [isRequesting, setIsRequesting] = useState(false); + + useEffect(() => { + + const onRequestReservasData = async () => { + setIsRequesting(true); + + try { + const jsonResponse = await fetch(`${API.BASE_URL}/commonArea/allCommonAreas`, { + method: "GET", + headers: { + 'Content-Type': 'application/json' + } + }) + + const response = await jsonResponse.json(); + console.log(response.message); + + setAreas(response.message); + + + + } catch (error) { + console.log("ERROR:" + error); + } + + setIsRequesting(false) + } + + onRequestReservasData() + + + }, [user]) + + + + return (
@@ -26,20 +69,46 @@ export default function AreaComun({navigation}){ Reserve su área común - - Hora de inicio - - - - Hora de finalización - - - - Lugar - - + + Área común + + + + Hora de inicio + + + + Hora de finalización + + + + +