fix merge issues and screens
This commit is contained in:
parent
669a28bed3
commit
b6e44c80c8
|
@ -27,14 +27,14 @@ function HomeTab({ route }) {
|
|||
return (
|
||||
|
||||
<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"
|
||||
}, 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"
|
||||
}, 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"
|
||||
}, 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: {
|
||||
|
@ -52,14 +52,14 @@ function HomeTabGuarda({ route }) {
|
|||
return (
|
||||
|
||||
<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"
|
||||
}, 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"
|
||||
}, 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"
|
||||
}, tabBarIcon: () => (<Icon mb="2" as={<MaterialCommunityIcons name={selected === 2 ? 'account' : 'account-outline'} />} color="#D7A86E" size="md" />)}} onclick={() => setSelected(2)} />
|
||||
</Tab.Navigator>
|
||||
|
@ -71,21 +71,26 @@ export default function App() {
|
|||
<NativeBaseProvider>
|
||||
<UserContextProvider>
|
||||
<NavigationContainer>
|
||||
<Stack.Navigator initialRouteName="LogIn">
|
||||
<Stack.Screen name="Inicio" component={Reservas} options={{
|
||||
<Stack.Navigator initialRouteName="Iniciar Sesión">
|
||||
{/* <Stack.Screen name="Mis Reservas" component={Reservas} options={{
|
||||
headerStyle: {
|
||||
backgroundColor: "#D7A86E"
|
||||
}
|
||||
}} />
|
||||
}} /> */}
|
||||
<Stack.Screen name="Comunicados" component={HomeTab} 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: {
|
||||
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: {
|
||||
backgroundColor: "#D7A86E"
|
||||
}
|
||||
|
|
|
@ -152,7 +152,7 @@ export default function AgregarInvitados({ navigation }) {
|
|||
<FormControl >
|
||||
<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"
|
||||
}} mt={1} onValueChange={onHandleChange("type_guest")}>
|
||||
<Select.Item label="Invitado Frecuente" value="Frecuente" />
|
||||
|
|
|
@ -93,7 +93,7 @@ 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" />}>
|
||||
<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
|
||||
</Button>
|
||||
<FlatList data={invitados} renderItem={({
|
||||
|
|
|
@ -186,22 +186,7 @@ export default function LogIn({ navigation }) {
|
|||
fontSize: 'xs'
|
||||
}}
|
||||
>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>
|
||||
<Button mt="2" backgroundColor="#D7A86E" onPress={iniciarSesion}
|
||||
>
|
||||
|
|
|
@ -243,7 +243,7 @@ export default function Profile({ navigation }) {
|
|||
return (
|
||||
|
||||
<Navigator>
|
||||
<Screen name="Perfil" component={ProfileView} />
|
||||
<Screen name="Datos Personales" component={ProfileView} />
|
||||
<Screen name="Contraseña" component={PasswordView} />
|
||||
|
||||
</Navigator>
|
||||
|
|
|
@ -2,7 +2,7 @@ import React, {useContext, useEffect, useState} from "react";
|
|||
import {
|
||||
Box,
|
||||
ScrollView,
|
||||
Fab,
|
||||
Text,
|
||||
Icon,
|
||||
Button,
|
||||
Heading
|
||||
|
@ -18,8 +18,10 @@ export default function Reservas({navigation}) {
|
|||
const { user } = useContext(UserContext)
|
||||
const [isRequesting, setIsRequesting] = useState(false);
|
||||
const [reservas, setReservas] = useState([]);
|
||||
const id = user._id;
|
||||
//const id = "6301df20dac7dcf76dcecade";
|
||||
// const id = user._id;
|
||||
const id = "6301df20dac7dcf76dcecade";
|
||||
|
||||
console.log(user);
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
|
@ -27,6 +29,7 @@ export default function Reservas({navigation}) {
|
|||
const onRequestReservasData = async () => {
|
||||
setIsRequesting(true);
|
||||
|
||||
console.log(user);
|
||||
try {
|
||||
const jsonResponse = await fetch(`${API.BASE_URL}/reservation/findReservationUser/`+`${id}`, {
|
||||
method: "GET",
|
||||
|
@ -52,6 +55,8 @@ export default function Reservas({navigation}) {
|
|||
|
||||
}, [user])
|
||||
|
||||
console.log(reservas);
|
||||
|
||||
|
||||
return (
|
||||
|
||||
|
@ -60,17 +65,17 @@ export default function Reservas({navigation}) {
|
|||
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" />}>
|
||||
<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
|
||||
</Button>
|
||||
|
||||
{
|
||||
{ reservas == [] ? <Text mt="9" ml='10'> No hay reservas relacionados a su usuario</Text> :
|
||||
|
||||
reservas.map(item => (
|
||||
<ReservasCard
|
||||
key={item._id}
|
||||
date={item.date_entry}
|
||||
startTime={item.start_time}
|
||||
endTime={item.finish_time}
|
||||
status={item.status}
|
||||
name={item.common_area_name}
|
||||
/>
|
||||
|
|
|
@ -38,30 +38,26 @@ export const ReservasCard = ({ date, startTime, endTime, status, name}) => {
|
|||
<Stack p="4" space={3}>
|
||||
<Stack space={2}>
|
||||
|
||||
<Badge backgroundColor={status == 1 ? 'tertiary.500' : 'danger.600'} _text={{
|
||||
color: "white"
|
||||
}} variant="solid" rounded="4">
|
||||
<Text bold={true} color='danger.50'> {status == 1 ? 'LIBRE' : 'RESERVADO'}</Text>
|
||||
</Badge>
|
||||
<Heading size="md" ml="-1">
|
||||
|
||||
<Heading size="lg" ml="-1">
|
||||
{name}
|
||||
</Heading>
|
||||
<Text fontSize="xs" _light={{
|
||||
color: "violet.500"
|
||||
<Text fontSize="md" _light={{
|
||||
color: "success.600"
|
||||
}} _dark={{
|
||||
color: "violet.400"
|
||||
}} fontWeight="500" ml="-0.5" mt="-1">
|
||||
{dateFormated}
|
||||
</Text>
|
||||
</Stack>
|
||||
<Text fontWeight="400">
|
||||
<Text fontSize="md" fontWeight="400">
|
||||
Hora de inicio: {startTime}
|
||||
</Text>
|
||||
<Text fontWeight="400">
|
||||
Hora de finalización: {endTime}
|
||||
</Text>
|
||||
|
||||
|
||||
</Stack>
|
||||
|
||||
|
||||
</Box>
|
||||
</Box>
|
||||
</ScrollView>
|
||||
|
@ -71,6 +67,5 @@ export const ReservasCard = ({ date, startTime, endTime, status, name}) => {
|
|||
ReservasCard.propTypes = {
|
||||
date: PropTypes.string.isRequired,
|
||||
startTime: PropTypes.string.isRequired,
|
||||
endTime: PropTypes.string.isRequired,
|
||||
status: PropTypes.string.isRequired
|
||||
}
|
|
@ -5,6 +5,7 @@
|
|||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "servicio-reservaciones",
|
||||
"version": "0.0.1",
|
||||
"license": "UNLICENSED",
|
||||
"dependencies": {
|
||||
|
|
Loading…
Reference in New Issue