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 + + + + +