From d5894d9fbc825a462708212a183bbbe7f17ae300 Mon Sep 17 00:00:00 2001 From: Anik Dhabal Babu <81948346+anikdhabal@users.noreply.github.com> Date: Tue, 28 Oct 2025 19:59:27 +0530 Subject: [PATCH] fix: update booking view UI for awaiting payment state (#24577) * fix: update booking view UI for awaiting payment state - Show calendar icon instead of green check for awaiting payment - Update title to show 'Your meeting is awaiting payment' or 'Your meeting is awaiting a payment method' - Update subtitle to show 'Complete your booking: {title} on {date}' - Handle both HOLD payment option and regular payment pending states - Fix unused variable warning Co-Authored-By: anik@cal.com * fix: correct formatToLocalizedDate parameters Use proper dateStyle parameter instead of time format number Co-Authored-By: anik@cal.com --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- .../bookings/views/bookings-single-view.tsx | 27 +++++++++++++++---- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/apps/web/modules/bookings/views/bookings-single-view.tsx b/apps/web/modules/bookings/views/bookings-single-view.tsx index c11ee70a1d..8dc896acf2 100644 --- a/apps/web/modules/bookings/views/bookings-single-view.tsx +++ b/apps/web/modules/bookings/views/bookings-single-view.tsx @@ -139,6 +139,7 @@ export default function Success(props: PageProps) { const status = bookingInfo?.status; const reschedule = bookingInfo.status === BookingStatus.ACCEPTED; const cancellationReason = bookingInfo.cancellationReason || bookingInfo.rejectionReason; + const isAwaitingPayment = props.paymentStatus && !props.paymentStatus.success; const attendees = bookingInfo?.attendees; @@ -296,6 +297,12 @@ export default function Success(props: PageProps) { if (isCancelled) { return ""; } + if (isAwaitingPayment && !isCancelled) { + return t("complete_your_booking_subject", { + title: eventName, + date: formatToLocalizedDate(date, undefined, "long", tz), + }); + } if (needsConfirmation) { if (props.profile.name !== null) { return t(`user_needs_to_confirm_or_reject_booking${titleSuffix}`, { @@ -374,12 +381,18 @@ export default function Success(props: PageProps) { const isRescheduled = bookingInfo?.rescheduled; const canCancelOrReschedule = !eventType?.disableCancelling || !eventType?.disableRescheduling; - const canCancelAndReschedule = !eventType?.disableCancelling && !eventType?.disableRescheduling; + const _canCancelAndReschedule = !eventType?.disableCancelling && !eventType?.disableRescheduling; const canCancel = !eventType?.disableCancelling; const canReschedule = !eventType?.disableRescheduling; const successPageHeadline = (() => { + if (isAwaitingPayment && !isCancelled) { + return props.paymentStatus?.paymentOption === "HOLD" + ? t("meeting_awaiting_payment_method") + : t("meeting_awaiting_payment"); + } + if (needsConfirmationAndReschedulable) { return isRecurringBooking ? t("booking_submitted_recurring") : t("booking_submitted"); } @@ -478,14 +491,18 @@ export default function Success(props: PageProps) { "mx-auto flex h-12 w-12 items-center justify-center rounded-full", isRoundRobin && "border-cal-bg dark:border-cal-bg-muted absolute bottom-0 right-0 z-10 h-12 w-12 border-8", - !giphyImage && isReschedulable && !needsConfirmation ? "bg-success" : "", - !giphyImage && isReschedulable && needsConfirmation ? "bg-subtle" : "", + !giphyImage && isReschedulable && !needsConfirmation && !isAwaitingPayment + ? "bg-success" + : "", + !giphyImage && isReschedulable && (needsConfirmation || isAwaitingPayment) + ? "bg-subtle" + : "", isCancelled ? "bg-error" : "" )}> - {!giphyImage && !needsConfirmation && isReschedulable && ( + {!giphyImage && !needsConfirmation && !isAwaitingPayment && isReschedulable && ( )} - {needsConfirmation && isReschedulable && ( + {(needsConfirmation || isAwaitingPayment) && isReschedulable && ( )} {isCancelled && }