From 174f1acd46c4ffbde88c04465e8fa6b6810ce113 Mon Sep 17 00:00:00 2001 From: Alberto Duarte Delgado Date: Mon, 30 Mar 2026 17:37:42 +0100 Subject: logica de reservas --- src/app/(protected)/(tabs)/reservations/index.tsx | 92 +++++++++++++++++++++-- 1 file changed, 84 insertions(+), 8 deletions(-) (limited to 'src/app/(protected)/(tabs)/reservations/index.tsx') diff --git a/src/app/(protected)/(tabs)/reservations/index.tsx b/src/app/(protected)/(tabs)/reservations/index.tsx index 817ec6e..56f7832 100644 --- a/src/app/(protected)/(tabs)/reservations/index.tsx +++ b/src/app/(protected)/(tabs)/reservations/index.tsx @@ -1,10 +1,55 @@ -import { StyleSheet, Text, View } from 'react-native'; +import { + ActivityIndicator, + FlatList, + Pressable, + StyleSheet, + Text, + View, +} from 'react-native'; +import { useReservations } from '@/features/reservations/hooks/useReservations'; export default function ReservationsScreen() { + const { reservations, loading, error, reload } = useReservations(); + + if (loading) { + return ( + + + + ); + } + + if (error) { + return ( + + {error} + + Reintentar + + + ); + } + return ( - Reservas - Pantalla en construcción. + Mis reservas + + item.id} + contentContainerStyle={styles.list} + ListEmptyComponent={ + No tienes reservas todavía + } + renderItem={({ item }) => ( + + {item.officeName} + Fecha: {item.date} + Inicio: {item.startTime} + Fin: {item.endTime} + + )} + /> ); } @@ -13,16 +58,47 @@ const styles = StyleSheet.create({ container: { flex: 1, padding: 16, - justifyContent: 'center', + }, + center: { + flex: 1, alignItems: 'center', - gap: 12, + justifyContent: 'center', + padding: 24, }, title: { fontSize: 28, fontWeight: '700', + marginBottom: 16, + }, + list: { + gap: 12, + }, + card: { + borderWidth: 1, + borderColor: '#ddd', + borderRadius: 12, + padding: 16, + gap: 6, + }, + cardTitle: { + fontSize: 18, + fontWeight: '600', + }, + error: { + color: 'red', + marginBottom: 12, + }, + button: { + backgroundColor: '#1f6feb', + paddingHorizontal: 16, + paddingVertical: 12, + borderRadius: 10, + }, + buttonText: { + color: '#fff', + fontWeight: '600', }, - text: { - fontSize: 16, - color: '#555', + empty: { + color: '#666', }, }); -- cgit v1.2.3-54-g00ecf