fix merge issues and screens

This commit is contained in:
Maria Sanchez 2022-08-31 22:58:53 -06:00
parent 669a28bed3
commit b6e44c80c8
8 changed files with 42 additions and 51 deletions

View File

@ -27,14 +27,14 @@ function HomeTab({ route }) {
return ( return (
<Tab.Navigator initialParams={user} initialRouteName="Comunicados" > <Tab.Navigator initialParams={user} initialRouteName="Comunicados" >
<Tab.Screen name="Comunicados" component={Home} initialParams={user} options={{headerStyle: { <Tab.Screen name="Mis Comunicados" component={Home} initialParams={user} options={{headerStyle: {
backgroundColor: "#D7A86E" backgroundColor: "#D7A86E"
}, tabBarIcon: () => (<Icon mb="2" as={<MaterialCommunityIcons name={selected === 0 ? 'home' : 'home-outline'} />} color="#D7A86E" size="md" />)}} onclick={() => setSelected(0)} }, tabBarIcon: () => (<Icon mb="2" as={<MaterialCommunityIcons name={selected === 0 ? 'home' : 'home-outline'} />} color="#D7A86E" size="md" />)}} onclick={() => setSelected(0)}
/> />
<Tab.Screen name="Reservas" component={Reservas } initialParams={user} options={{headerStyle: { <Tab.Screen name="Mis Reservas" component={Reservas } initialParams={user} options={{headerStyle: {
backgroundColor: "#D7A86E" backgroundColor: "#D7A86E"
}, tabBarIcon: () => (<Icon mb="2" as={<MaterialCommunityIcons name={selected === 1 ? 'tree' : 'tree-outline'} />} color="#D7A86E" size="md" />)} } onclick={() => setSelected(1)} /> }, tabBarIcon: () => (<Icon mb="2" as={<MaterialCommunityIcons name={selected === 1 ? 'tree' : 'tree-outline'} />} color="#D7A86E" size="md" />)} } onclick={() => setSelected(1)} />
<Tab.Screen name="Invitados" component={Invitados} initialParams={user} options={{headerStyle: { <Tab.Screen name="Mis Invitados" component={Invitados} initialParams={user} options={{headerStyle: {
backgroundColor: "#D7A86E" backgroundColor: "#D7A86E"
}, tabBarIcon: () => (<Icon mb="2" as={<MaterialCommunityIcons name={selected === 1 ? 'contacts' : 'contacts-outline'} />} color="#D7A86E" size="md" />)} } onclick={() => setSelected(1)} /> }, tabBarIcon: () => (<Icon mb="2" as={<MaterialCommunityIcons name={selected === 1 ? 'contacts' : 'contacts-outline'} />} color="#D7A86E" size="md" />)} } onclick={() => setSelected(1)} />
<Tab.Screen name="Perfil" component={Profile} initialParams={user} options={{headerStyle: { <Tab.Screen name="Perfil" component={Profile} initialParams={user} options={{headerStyle: {
@ -52,14 +52,14 @@ function HomeTabGuarda({ route }) {
return ( return (
<Tab.Navigator initialParams={user} initialRouteName="Comunicados" > <Tab.Navigator initialParams={user} initialRouteName="Comunicados" >
<Tab.Screen name="Comunicados" component={Home} initialParams={user} options={{headerStyle: { <Tab.Screen name="Mis Comunicados Guarda" component={Home} initialParams={user} options={{headerStyle: {
backgroundColor: "#D7A86E" backgroundColor: "#D7A86E"
}, tabBarIcon: () => (<Icon mb="2" as={<MaterialCommunityIcons name={selected === 0 ? 'home' : 'home-outline'} />} color="#D7A86E" size="md" />)}} onclick={() => setSelected(0)} }, tabBarIcon: () => (<Icon mb="2" as={<MaterialCommunityIcons name={selected === 0 ? 'home' : 'home-outline'} />} color="#D7A86E" size="md" />)}} onclick={() => setSelected(0)}
/> />
<Tab.Screen name="Invitados" component={Invitados} initialParams={user} options={{headerStyle: { <Tab.Screen name="Mis Invitados" component={Invitados} initialParams={user} options={{headerStyle: {
backgroundColor: "#D7A86E" backgroundColor: "#D7A86E"
}, tabBarIcon: () => (<Icon mb="2" as={<MaterialCommunityIcons name={selected === 1 ? 'contacts' : 'contacts-outline'} />} color="#D7A86E" size="md" />)} } onclick={() => setSelected(1)} /> }, tabBarIcon: () => (<Icon mb="2" as={<MaterialCommunityIcons name={selected === 1 ? 'contacts' : 'contacts-outline'} />} color="#D7A86E" size="md" />)} } onclick={() => setSelected(1)} />
<Tab.Screen name="Perfil" component={Profile} initialParams={user} options={{headerStyle: { <Tab.Screen name="Mi Perfil" component={Profile} initialParams={user} options={{headerStyle: {
backgroundColor: "#D7A86E" backgroundColor: "#D7A86E"
}, tabBarIcon: () => (<Icon mb="2" as={<MaterialCommunityIcons name={selected === 2 ? 'account' : 'account-outline'} />} color="#D7A86E" size="md" />)}} onclick={() => setSelected(2)} /> }, tabBarIcon: () => (<Icon mb="2" as={<MaterialCommunityIcons name={selected === 2 ? 'account' : 'account-outline'} />} color="#D7A86E" size="md" />)}} onclick={() => setSelected(2)} />
</Tab.Navigator> </Tab.Navigator>
@ -71,21 +71,26 @@ export default function App() {
<NativeBaseProvider> <NativeBaseProvider>
<UserContextProvider> <UserContextProvider>
<NavigationContainer> <NavigationContainer>
<Stack.Navigator initialRouteName="LogIn"> <Stack.Navigator initialRouteName="Iniciar Sesión">
<Stack.Screen name="Inicio" component={Reservas} options={{ {/* <Stack.Screen name="Mis Reservas" component={Reservas} options={{
headerStyle: { headerStyle: {
backgroundColor: "#D7A86E" backgroundColor: "#D7A86E"
} }
}} /> }} /> */}
<Stack.Screen name="Comunicados" component={HomeTab} options={{ headerShown: false }} /> <Stack.Screen name="Comunicados" component={HomeTab} options={{ headerShown: false }} />
<Stack.Screen name="ComunicadosGuarda" component={HomeTabGuarda} options={{ headerShown: false }} /> <Stack.Screen name="Comunicados Guarda" component={HomeTabGuarda} options={{ headerShown: false }} />
<Stack.Screen name="Password" component={RecoverPassword} />
<Stack.Screen name="area" component={AreaComun} options={{ <Stack.Screen name="Reservar" component={AreaComun} options={{
headerStyle: { headerStyle: {
backgroundColor: "#D7A86E" backgroundColor: "#D7A86E"
} }
}} /> }} />
<Stack.Screen name="invitado" component={AgregarInvitados} options={{ <Stack.Screen name="Agregar Invitado" component={AgregarInvitados} options={{
headerStyle: {
backgroundColor: "#D7A86E"
}
}} />
<Stack.Screen name="Iniciar Sesión" component={LogIn} options={{
headerStyle: { headerStyle: {
backgroundColor: "#D7A86E" backgroundColor: "#D7A86E"
} }

View File

@ -152,7 +152,7 @@ export default function AgregarInvitados({ navigation }) {
<FormControl > <FormControl >
<FormControl.Label>Tipo de invitado</FormControl.Label> <FormControl.Label>Tipo de invitado</FormControl.Label>
<Select onChangeText={onHandleChange("type_guest")} selectedValue={categoria} minWidth="200" accessibilityLabel="Choose Service" placeholder="Choose Service" _selectedItem={{ <Select onChangeText={onHandleChange("type_guest")} selectedValue={categoria} minWidth="200" accessibilityLabel="Choose Service" placeholder="Elija el tipo de invitado" _selectedItem={{
bg: "teal.600" bg: "teal.600"
}} mt={1} onValueChange={onHandleChange("type_guest")}> }} mt={1} onValueChange={onHandleChange("type_guest")}>
<Select.Item label="Invitado Frecuente" value="Frecuente" /> <Select.Item label="Invitado Frecuente" value="Frecuente" />

View File

@ -93,7 +93,7 @@ export default function Invitados({navigation}) {
<Heading fontSize="xl" p="4" pb="3"> <Heading fontSize="xl" p="4" pb="3">
Lista de invitados Lista de invitados
</Heading> </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" />}> <Button width='200' mb="4" mt="4" ml='85' backgroundColor='tertiary.600' onPress={() => navigation.navigate('Agregar Invitado')} icon={<Icon mb="0.5" as={<MaterialCommunityIcons name={'plus'} />} color="white" size="sm" />}>
Agregar invitado Agregar invitado
</Button> </Button>
<FlatList data={invitados} renderItem={({ <FlatList data={invitados} renderItem={({

View File

@ -186,22 +186,7 @@ export default function LogIn({ navigation }) {
fontSize: 'xs' fontSize: 'xs'
}} }}
>Debe ingresar una contraseña</FormControl.ErrorMessage> } >Debe ingresar una contraseña</FormControl.ErrorMessage> }
<Link
_text={{
fontSize: "xs",
fontWeight: "500",
color: "indigo.500",
marginTop: "10"
}}
alignSelf="flex-end"
mt="1"
onPress={() => navigation.navigate('Password')}
>
Recuperar contraseña
</Link>
</FormControl> </FormControl>
<Button mt="2" backgroundColor="#D7A86E" onPress={iniciarSesion} <Button mt="2" backgroundColor="#D7A86E" onPress={iniciarSesion}
> >

View File

@ -243,7 +243,7 @@ export default function Profile({ navigation }) {
return ( return (
<Navigator> <Navigator>
<Screen name="Perfil" component={ProfileView} /> <Screen name="Datos Personales" component={ProfileView} />
<Screen name="Contraseña" component={PasswordView} /> <Screen name="Contraseña" component={PasswordView} />
</Navigator> </Navigator>

View File

@ -2,7 +2,7 @@ import React, {useContext, useEffect, useState} from "react";
import { import {
Box, Box,
ScrollView, ScrollView,
Fab, Text,
Icon, Icon,
Button, Button,
Heading Heading
@ -18,8 +18,10 @@ export default function Reservas({navigation}) {
const { user } = useContext(UserContext) const { user } = useContext(UserContext)
const [isRequesting, setIsRequesting] = useState(false); const [isRequesting, setIsRequesting] = useState(false);
const [reservas, setReservas] = useState([]); const [reservas, setReservas] = useState([]);
const id = user._id; // const id = user._id;
//const id = "6301df20dac7dcf76dcecade"; const id = "6301df20dac7dcf76dcecade";
console.log(user);
useEffect(() => { useEffect(() => {
@ -27,6 +29,7 @@ export default function Reservas({navigation}) {
const onRequestReservasData = async () => { const onRequestReservasData = async () => {
setIsRequesting(true); setIsRequesting(true);
console.log(user);
try { try {
const jsonResponse = await fetch(`${API.BASE_URL}/reservation/findReservationUser/`+`${id}`, { const jsonResponse = await fetch(`${API.BASE_URL}/reservation/findReservationUser/`+`${id}`, {
method: "GET", method: "GET",
@ -52,6 +55,8 @@ export default function Reservas({navigation}) {
}, [user]) }, [user])
console.log(reservas);
return ( return (
@ -60,17 +65,17 @@ export default function Reservas({navigation}) {
Lista de reservas Lista de reservas
</Heading> </Heading>
<ScrollView showsVerticalScrollIndicator={false}> <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" />}> <Button width='200' mb="4" mt="4" ml='85' backgroundColor='tertiary.600' onPress={() => navigation.navigate('Reservar')} icon={<Icon mb="0.5" as={<MaterialCommunityIcons name={'plus'} />} color="white" size="sm" />}>
Reservar Reservar
</Button> </Button>
{ { reservas == [] ? <Text mt="9" ml='10'> No hay reservas relacionados a su usuario</Text> :
reservas.map(item => ( reservas.map(item => (
<ReservasCard <ReservasCard
key={item._id} key={item._id}
date={item.date_entry} date={item.date_entry}
startTime={item.start_time} startTime={item.start_time}
endTime={item.finish_time}
status={item.status} status={item.status}
name={item.common_area_name} name={item.common_area_name}
/> />

View File

@ -38,30 +38,26 @@ export const ReservasCard = ({ date, startTime, endTime, status, name}) => {
<Stack p="4" space={3}> <Stack p="4" space={3}>
<Stack space={2}> <Stack space={2}>
<Badge backgroundColor={status == 1 ? 'tertiary.500' : 'danger.600'} _text={{
color: "white" <Heading size="lg" ml="-1">
}} variant="solid" rounded="4">
<Text bold={true} color='danger.50'> {status == 1 ? 'LIBRE' : 'RESERVADO'}</Text>
</Badge>
<Heading size="md" ml="-1">
{name} {name}
</Heading> </Heading>
<Text fontSize="xs" _light={{ <Text fontSize="md" _light={{
color: "violet.500" color: "success.600"
}} _dark={{ }} _dark={{
color: "violet.400" color: "violet.400"
}} fontWeight="500" ml="-0.5" mt="-1"> }} fontWeight="500" ml="-0.5" mt="-1">
{dateFormated} {dateFormated}
</Text> </Text>
</Stack> </Stack>
<Text fontWeight="400"> <Text fontSize="md" fontWeight="400">
Hora de inicio: {startTime} Hora de inicio: {startTime}
</Text> </Text>
<Text fontWeight="400">
Hora de finalización: {endTime}
</Text>
</Stack> </Stack>
</Box> </Box>
</Box> </Box>
</ScrollView> </ScrollView>
@ -71,6 +67,5 @@ export const ReservasCard = ({ date, startTime, endTime, status, name}) => {
ReservasCard.propTypes = { ReservasCard.propTypes = {
date: PropTypes.string.isRequired, date: PropTypes.string.isRequired,
startTime: PropTypes.string.isRequired, startTime: PropTypes.string.isRequired,
endTime: PropTypes.string.isRequired,
status: PropTypes.string.isRequired status: PropTypes.string.isRequired
} }

View File

@ -5,6 +5,7 @@
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "servicio-reservaciones",
"version": "0.0.1", "version": "0.0.1",
"license": "UNLICENSED", "license": "UNLICENSED",
"dependencies": { "dependencies": {