From c70541b4f5e154a8c6c7e4640c0257a46ed8bf29 Mon Sep 17 00:00:00 2001 From: Jose Selesan Date: Mon, 8 Jun 2026 16:14:27 -0300 Subject: [PATCH] refactor(public-booking): remove CourtDetails component and simplify canGoBack logic --- .../public-booking/public-booking-page.tsx | 47 ++----------------- 1 file changed, 4 insertions(+), 43 deletions(-) diff --git a/apps/frontend/src/features/public-booking/public-booking-page.tsx b/apps/frontend/src/features/public-booking/public-booking-page.tsx index e1bce59..3811e01 100644 --- a/apps/frontend/src/features/public-booking/public-booking-page.tsx +++ b/apps/frontend/src/features/public-booking/public-booking-page.tsx @@ -34,7 +34,6 @@ import { Moon, Share2, ShieldCheck, - Shirt, Sparkles, Sun, Trophy, @@ -553,8 +552,7 @@ function PublicBookingDesktop(props: BookingShellProps) { const currentStep = getStep(selectedSlot, props.form.formState.isValid); const completedSteps = getCompletedSteps(selectedSlot, props.form.formState.isValid); const selectedDay = dayOptions.find((option) => option.value === selectedDate); - const currentDayIndex = dayOptions.findIndex((option) => option.value === selectedDate); - const canGoBackButton = canGoBack || currentDayIndex > 0; + const canGoBackButton = canGoBack; return ( -
- - -
+ )} @@ -1161,41 +1156,6 @@ function BookingTimeline({ ); } -function CourtDetails({ court }: { court?: PublicAvailabilityCourt }) { - return ( - -
-
- -
-
-

- {court?.courtName ? `${court.courtName} de ${court.sport.name}` : 'Cancha'} -

-
-

- - Superficie: Césped sintético -

-

- - Turnos de {court?.slotDurationMinutes ?? 60} minutos -

-

- - Iluminación LED -

-

- - Vestuarios disponibles -

-
-
-
-
- ); -} - function SelectedSlotCard(props: BookingShellProps & { compact?: boolean }) { const { selectedSlot, @@ -1579,7 +1539,8 @@ export function PublicBookingPage({ complexSlug }: PublicBookingPageProps) { visibleCourts.length, ]); - const canGoBack = windowStartOffset > 0; + const currentDayIndex = dayOptions.findIndex((option) => option.value === selectedDate); + const canGoBack = windowStartOffset > 0 || currentDayIndex > 0; const selectDate = (date: string) => { setSelectedDate(date);