time picker change and name of common area

This commit is contained in:
Maria Sanchez 2022-08-23 11:58:35 -06:00
parent 98ef5dab17
commit 06ceecbfbf
3 changed files with 27 additions and 27 deletions

View File

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

View File

@ -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}) {
<Heading fontSize="xl" p="4" pb="3">
Lista de invitados
</Heading>
<Button width='200' mb="4" mt="4" ml='85' backgroundColor='tertiary.600' onPress={() => navigation.navigate('invitado')} icon={<Icon mb="0.5" as={<MaterialCommunityIcons name={'plus'} />} color="white" size="sm" />}>
Agregar invitado
</Button>
<FlatList data={invitados} renderItem={({
item
}) => <Box key={item._id} borderBottomWidth="1" _dark={{
@ -69,7 +72,7 @@ export default function Invitados({navigation}) {
<Text color="coolGray.600" _dark={{
color: "warmGray.200"
}}>
{item.phone}
(506) {item.phone}
</Text>
</VStack>
<Spacer />
@ -82,9 +85,7 @@ export default function Invitados({navigation}) {
</Box>} keyExtractor={item => item.id} />
<Button width='200' mt="4" ml='85' backgroundColor='tertiary.600' onPress={() => navigation.navigate('invitado')}>
Agregar invitado
</Button>
</Box>

View File

@ -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';
@ -17,6 +19,7 @@ export default function Reservas({navigation}) {
const [isRequesting, setIsRequesting] = useState(false);
const [reservas, setReservas] = useState([]);
useEffect(() => {
const onRequestReservasData = async () => {
@ -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);
@ -56,7 +53,14 @@ export default function Reservas({navigation}) {
return (
<Box>
<Heading fontSize="xl" p="4" pb="3">
Lista de reservas
</Heading>
<ScrollView showsVerticalScrollIndicator={false}>
<Button width='200' mb="4" mt="4" ml='85' backgroundColor='tertiary.600' onPress={() => navigation.navigate('area')} icon={<Icon mb="0.5" as={<MaterialCommunityIcons name={'plus'} />} color="white" size="sm" />}>
Reservar
</Button>
{
reservas.map(item => (
@ -70,17 +74,8 @@ export default function Reservas({navigation}) {
))
}
<Box height="200" w="300" shadow="2" rounded="lg" m='5' ml='9' _dark={{
bg: "coolGray.200:alpha.20"
}} _light={{
bg: "coolGray.200:alpha.20"
}}>
<Fab renderInPortal={false} shadow={2} size="sm" icon={<Icon mb="0.5" as={<MaterialCommunityIcons name={'plus'} />} color="white" size="sm" />} onPress={() => navigation.navigate('area')}/>
</Box>
</ScrollView>
</Box>
);
}