From 4eebbb2ff5df645655813a530b84a6395a44bffd Mon Sep 17 00:00:00 2001 From: Anita Date: Tue, 21 Apr 2026 17:36:49 +0100 Subject: offices ajuste de cabecera --- src/app/(protected)/(tabs)/offices/index.tsx | 314 ++++++++++++++------------- 1 file changed, 164 insertions(+), 150 deletions(-) (limited to 'src/app/(protected)/(tabs)') diff --git a/src/app/(protected)/(tabs)/offices/index.tsx b/src/app/(protected)/(tabs)/offices/index.tsx index c84123a..67fcd92 100644 --- a/src/app/(protected)/(tabs)/offices/index.tsx +++ b/src/app/(protected)/(tabs)/offices/index.tsx @@ -44,7 +44,7 @@ export default function OfficesScreen() { if (error) { return ( - {error} + {error} Reintentar @@ -53,132 +53,122 @@ export default function OfficesScreen() { } return ( - - - {/* HEADER */} - - Espacios disponibles - - {/* SEARCH */} - + + {/* cabecera superior de la pantalla */} + + Espacios + - setShowOnlyFavorites((current) => !current)} - > - + {/* herramientas de filtrado */} + + - setShowOnlyFavorites((current) => !current)} > - Solo favoritos - - - + + + Solo favoritos + + + + + {/* contador de resultados */} + + {filteredOffices.length} espacio + {filteredOffices.length !== 1 ? "s" : ""} encontrados + + + {/* lista */} + item.id} + contentContainerStyle={styles.list} + renderItem={({ item }) => { + const isFav = favoriteOfficeIdsSet.has(item.id); + + return ( + + + + + + + + + + + {item.name} + + {item.location} + + - {/* COUNT */} - - {filteredOffices.length} espacio - {filteredOffices.length !== 1 ? 's' : ''} encontrados - - - {/* LIST */} - item.id} - contentContainerStyle={styles.list} - renderItem={({ item }) => { - const isFav = favoriteOfficeIdsSet.has(item.id); - - return ( - - - - {/* IMAGE PLACEHOLDER */} - {/* - 🏢 - */} - - - - {/* INFO */} - - - - {item.name} - - {item.location} - + › - › - + + {item.capacity} personas + - - {item.capacity} personas - - - - {/* - {item.price ?? '—'} - */} - - - + - {isFav ? 'Favorito' : 'Disponible'} - + + {isFav ? "Favorito" : "Disponible"} + + - - - - ); - }} - ListEmptyComponent={ - - - {showOnlyFavorites - ? 'No tienes espacios favoritos con estos filtros' - : 'No se encontraron espacios'} - - - } - /> + + + ); + }} + ListEmptyComponent={ + + + {showOnlyFavorites + ? "No tienes espacios favoritos con estos filtros" + : "No se encontraron espacios"} + + + } + /> + - ); } @@ -188,31 +178,55 @@ const styles = StyleSheet.create({ backgroundColor: theme.colors.background, }, -content: { - flex: 1, - width: '100%', - maxWidth: theme.layout.contentWidth, - alignSelf: 'center', -}, + content: { + flex: 1, + width: "100%", + maxWidth: theme.layout.contentWidth, + alignSelf: "center", + }, center: { flex: 1, - justifyContent: 'center', - alignItems: 'center', + justifyContent: "center", + alignItems: "center", + padding: theme.spacing.xl, + gap: theme.spacing.md, + backgroundColor: theme.colors.background, }, - header: { + // cabecera superior de la pantalla + topBar: { backgroundColor: theme.colors.surface, - padding: theme.spacing.xl, borderBottomWidth: 1, - borderColor: theme.colors.border, + borderBottomColor: theme.colors.border, + paddingHorizontal: theme.spacing.xl, + paddingTop: theme.spacing.xxxl, + paddingBottom: theme.spacing.lg, }, - title: { - fontSize: theme.typography.xxxl, + // titulo principal de la cabecera + topBarTitle: { + fontSize: theme.typography.xxl, fontWeight: theme.fontWeight.semibold, color: theme.colors.text, - marginBottom: theme.spacing.md, + textAlign: "left", + maxWidth: theme.layout.contentWidth, + width: "100%", + alignSelf: "center", + }, + + errorText: { + color: theme.colors.error, + textAlign: "center", + }, + + // bloque de busqueda y filtros + toolsCard: { + backgroundColor: theme.colors.surface, + padding: theme.spacing.xl, + gap: theme.spacing.md, + borderBottomWidth: 1, + borderBottomColor: theme.colors.border, }, search: { @@ -222,18 +236,18 @@ content: { borderRadius: theme.radius.lg, paddingHorizontal: theme.spacing.lg, paddingVertical: theme.spacing.md, + color: theme.colors.text, }, favoriteFilterButton: { - marginTop: theme.spacing.md, borderWidth: 1, borderColor: theme.colors.primary, borderRadius: theme.radius.lg, paddingHorizontal: theme.spacing.lg, paddingVertical: theme.spacing.md, - flexDirection: 'row', - alignItems: 'center', - justifyContent: 'center', + flexDirection: "row", + alignItems: "center", + justifyContent: "center", gap: theme.spacing.sm, }, @@ -272,7 +286,7 @@ content: { }, cardContent: { - flexDirection: 'row', + flexDirection: "row", gap: theme.spacing.lg, }, @@ -281,12 +295,8 @@ content: { height: 80, borderRadius: theme.radius.lg, backgroundColor: theme.colors.primarySoft, - alignItems: 'center', - justifyContent: 'center', - }, - - imageIcon: { - fontSize: 28, + alignItems: "center", + justifyContent: "center", }, info: { @@ -295,9 +305,13 @@ content: { }, rowBetween: { - flexDirection: 'row', - justifyContent: 'space-between', - alignItems: 'flex-start', + flexDirection: "row", + justifyContent: "space-between", + alignItems: "flex-start", + }, + + infoMain: { + flex: 1, }, cardTitle: { @@ -322,14 +336,9 @@ content: { }, footer: { - flexDirection: 'row', - justifyContent: 'space-between', - alignItems: 'center', - }, - - price: { - color: theme.colors.primary, - fontWeight: theme.fontWeight.medium, + flexDirection: "row", + justifyContent: "space-between", + alignItems: "center", }, badge: { @@ -353,7 +362,7 @@ content: { }, emptyBox: { - alignItems: 'center', + alignItems: "center", padding: theme.spacing.xxxl, }, @@ -361,6 +370,11 @@ content: { color: theme.colors.textSecondary, }, + errorText: { + color: theme.colors.error, + textAlign: "center", + }, + primaryButton: { marginTop: theme.spacing.md, backgroundColor: theme.colors.primary, -- cgit v1.2.3-54-g00ecf