diff options
Diffstat (limited to 'src/app')
| -rw-r--r-- | src/app/(protected)/(tabs)/_layout.tsx~ | 0 | ||||
| -rw-r--r-- | src/app/(protected)/offices/\ | 129 |
2 files changed, 0 insertions, 129 deletions
diff --git a/src/app/(protected)/(tabs)/_layout.tsx~ b/src/app/(protected)/(tabs)/_layout.tsx~ deleted file mode 100644 index e69de29..0000000 --- a/src/app/(protected)/(tabs)/_layout.tsx~ +++ /dev/null diff --git a/src/app/(protected)/offices/\ b/src/app/(protected)/offices/\ deleted file mode 100644 index 34095c5..0000000 --- a/src/app/(protected)/offices/\ +++ /dev/null @@ -1,129 +0,0 @@ -import { Link, useLocalSearchParams } from 'expo-router'; -import { ActivityIndicator, Pressable, StyleSheet, Text, View } from 'react-native'; -import { useOffice } from '@/features/offices/hooks/useOffice'; - -export default function OfficeDetailScreen() { - const params = useLocalSearchParams<{ officeId: string }>(); - const officeId = typeof params.officeId === 'string' ? params.officeId : undefined; - - const { office, loading, error, reload } = useOffice(officeId); - - if (loading) { - return ( - <View style={styles.center}> - <ActivityIndicator size="large" /> - </View> - ); - } - - if (error || !office) { - return ( - <View style={styles.center}> - <Text style={styles.error}>{error ?? 'No se pudo cargar la oficina'}</Text> - - <Pressable style={styles.button} onPress={reload}> - <Text style={styles.buttonText}>Reintentar</Text> - </Pressable> - - <Link href="/(protected)/offices" asChild> - <Pressable style={styles.secondaryButton}> - <Text style={styles.buttonText}>Volver a espacios</Text> - </Pressable> - </Link> - </View> - ); - } - - return ( - <View style={styles.container}> - <Text style={styles.title}>{office.name}</Text> - - <View style={styles.card}> - <Text style={styles.label}>Ubicación</Text> - <Text style={styles.value}>{office.location}</Text> - - <Text style={styles.label}>Capacidad</Text> - <Text style={styles.value}>{office.capacity} personas</Text> - - {office.description ? ( - <> - <Text style={styles.label}>Descripción</Text> - <Text style={styles.value}>{office.description}</Text> - </> - ) : null} - </View> - - <Link - href={{ - pathname: '/(protected)/reservations/create', - params: { - officeId: office.id, - officeName: office.name, - }, - }} - asChild - > - <Pressable style={styles.button}> - <Text style={styles.buttonText}>Reservar este espacio</Text> - </Pressable> - </Link> - - </View> - ); -} - -const styles = StyleSheet.create({ - container: { - flex: 1, - padding: 16, - gap: 16, - }, - center: { - flex: 1, - alignItems: 'center', - justifyContent: 'center', - padding: 24, - gap: 12, - }, - title: { - fontSize: 28, - fontWeight: '700', - }, - card: { - borderWidth: 1, - borderColor: '#ddd', - borderRadius: 12, - padding: 16, - gap: 10, - }, - label: { - fontSize: 14, - fontWeight: '700', - color: '#444', - }, - value: { - fontSize: 16, - color: '#111', - }, - button: { - backgroundColor: '#1f6feb', - paddingVertical: 14, - borderRadius: 10, - alignItems: 'center', - }, - secondaryButton: { - backgroundColor: '#555', - paddingVertical: 14, - paddingHorizontal: 16, - borderRadius: 10, - alignItems: 'center', - }, - buttonText: { - color: '#fff', - fontWeight: '600', - }, - error: { - color: 'red', - textAlign: 'center', - }, -}); |