From 06ceecbfbf4cf4e82b7fc0977d82ed55edcd6c45 Mon Sep 17 00:00:00 2001 From: Maria Sanchez Date: Tue, 23 Aug 2022 11:58:35 -0600 Subject: [PATCH] time picker change and name of common area --- mobile-ui/components/AreaComun.js | 8 +++++-- mobile-ui/components/Invitados.js | 11 +++++----- mobile-ui/components/Reservas.js | 35 +++++++++++++------------------ 3 files changed, 27 insertions(+), 27 deletions(-) diff --git a/mobile-ui/components/AreaComun.js b/mobile-ui/components/AreaComun.js index 66855e49..b3cdb038 100644 --- a/mobile-ui/components/AreaComun.js +++ b/mobile-ui/components/AreaComun.js @@ -12,6 +12,7 @@ import { UserContext } from "../context/UserContext"; import { API } from "../environment/api"; import {TimePicker} from 'react-native-simple-time-picker'; import { View, StyleSheet } from "react-native"; +import { number } from "prop-types"; export default function AreaComun({navigation}){ const { user } = useContext(UserContext) @@ -24,6 +25,7 @@ export default function AreaComun({navigation}){ const [endSelectedHours, setEndSelectedHours] = useState(0); const [endSelectedMinutes, setEndSelectedMinutes] = useState(0); + const date = new Date(); useEffect(() => { @@ -62,11 +64,13 @@ export default function AreaComun({navigation}){ const postReserva = async() => { + //console.log(date); + const data = { - "start_time": selectedHours + ":" +selectedMinutes, + "start_time": Number.parseInt(selectedHours) + ":" +selectedMinutes, "finish_time": endSelectedHours + ":" +endSelectedMinutes, - "date_entry": "", + "date_entry": date, "user_id" : user._id, "common_area_id": service diff --git a/mobile-ui/components/Invitados.js b/mobile-ui/components/Invitados.js index 45602455..a839800c 100644 --- a/mobile-ui/components/Invitados.js +++ b/mobile-ui/components/Invitados.js @@ -4,7 +4,7 @@ import { UserContext } from "../context/UserContext"; import { API } from "../environment/api"; import { Box, Button, - Center, FormControl, Heading, ScrollView, VStack,FlatList, HStack,Avatar,Spacer,Text + Center, FormControl, Heading, ScrollView, VStack,FlatList, HStack,Avatar,Spacer,Text, Icon } from "native-base"; export default function Invitados({navigation}) { @@ -48,6 +48,9 @@ export default function Invitados({navigation}) { Lista de invitados + - {item.phone} + (506) {item.phone} @@ -82,9 +85,7 @@ export default function Invitados({navigation}) { } keyExtractor={item => item.id} /> - + diff --git a/mobile-ui/components/Reservas.js b/mobile-ui/components/Reservas.js index 1797e05a..8ac0b01b 100644 --- a/mobile-ui/components/Reservas.js +++ b/mobile-ui/components/Reservas.js @@ -3,7 +3,9 @@ import { Box, ScrollView, Fab, - Icon + Icon, + Button, + Heading } from "native-base"; import { API } from "../environment/api"; import { MaterialCommunityIcons } from '@expo/vector-icons'; @@ -16,6 +18,7 @@ export default function Reservas({navigation}) { const { user } = useContext(UserContext) const [isRequesting, setIsRequesting] = useState(false); const [reservas, setReservas] = useState([]); + useEffect(() => { @@ -35,12 +38,6 @@ export default function Reservas({navigation}) { setReservas(response.message); - try { - - - } catch (error) { - console.log("ERROR:" + error); - } } catch (error) { console.log("ERROR:" + error); @@ -55,8 +52,15 @@ export default function Reservas({navigation}) { return ( - + + + + Lista de reservas + + { reservas.map(item => ( @@ -70,17 +74,8 @@ export default function Reservas({navigation}) { )) } - - - } color="white" size="sm" />} onPress={() => navigation.navigate('area')}/> - - ); - - - + + + ); } \ No newline at end of file