diff --git a/apps/web/components/booking/BookingListItem.tsx b/apps/web/components/booking/BookingListItem.tsx index c7925b9178..86933ef541 100644 --- a/apps/web/components/booking/BookingListItem.tsx +++ b/apps/web/components/booking/BookingListItem.tsx @@ -515,7 +515,7 @@ function BookingListItem(booking: BookingItemProps) { - + {isUpcoming && !isCancelled ? ( <> {isPending && (userId === booking.user?.id || booking.isUserTeamAdminOrOwner) && ( @@ -526,6 +526,7 @@ function BookingListItem(booking: BookingItemProps) { ) : null} {isBookingInPast && isPending && !isConfirmed ? : null} + {isBookingInPast && isConfirmed ? : null} {(showViewRecordingsButton || showCheckRecordingButton) && ( )} diff --git a/apps/web/modules/bookings/views/bookings-single-view.tsx b/apps/web/modules/bookings/views/bookings-single-view.tsx index 6ed383cb2e..98d084822b 100644 --- a/apps/web/modules/bookings/views/bookings-single-view.tsx +++ b/apps/web/modules/bookings/views/bookings-single-view.tsx @@ -310,7 +310,7 @@ export default function Success(props: PageProps) { function getTitle(): string { const titleSuffix = props.recurringBookings ? "_recurring" : ""; const titlePrefix = isRoundRobin ? "round_robin_" : ""; - if (isCancelled || isBookingInPast) { + if (isCancelled) { return ""; } if (needsConfirmation) { @@ -355,7 +355,7 @@ export default function Success(props: PageProps) { const providerName = guessEventLocationType(location)?.label; const rescheduleProviderName = guessEventLocationType(rescheduleLocation)?.label; const isBookingInPast = new Date(bookingInfo.endTime) < new Date(); - const isReschedulable = !isCancelled && !isBookingInPast; + const isReschedulable = !isCancelled; const bookingCancelledEventProps = { booking: bookingInfo, @@ -367,6 +367,32 @@ export default function Success(props: PageProps) { eventType, }; + const isRecurringBooking = props.recurringBookings; + const needsConfirmationAndReschedulable = needsConfirmation && isReschedulable; + const isNotAttendingSeatedEvent = isCancelled && seatReferenceUid; + const isEventCancelled = isCancelled && !seatReferenceUid; + const isPastBooking = isBookingInPast; + + const successPageHeadline = (() => { + if (needsConfirmationAndReschedulable) { + return isRecurringBooking ? t("booking_submitted_recurring") : t("booking_submitted"); + } + + if (isNotAttendingSeatedEvent) { + return t("no_longer_attending"); + } + + if (isEventCancelled) { + return t("event_cancelled"); + } + + if (isPastBooking) { + return t("event_is_in_the_past"); + } + + return isRecurringBooking ? t("meeting_is_scheduled_recurring") : t("meeting_is_scheduled"); + })(); + return (
{!isEmbed && !isFeedbackMode && ( @@ -439,7 +465,7 @@ export default function Success(props: PageProps) { "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" : "", - isCancelled || isBookingInPast ? "bg-error" : "" + isCancelled ? "bg-error" : "" )}> {!giphyImage && !needsConfirmation && isReschedulable && ( @@ -447,9 +473,7 @@ export default function Success(props: PageProps) { {needsConfirmation && isReschedulable && ( )} - {(isCancelled || isBookingInPast) && ( - - )} + {isCancelled && }
@@ -457,19 +481,7 @@ export default function Success(props: PageProps) { className="text-emphasis text-2xl font-semibold leading-6" data-testid={isCancelled ? "cancelled-headline" : ""} id="modal-headline"> - {needsConfirmation && isReschedulable - ? props.recurringBookings - ? t("booking_submitted_recurring") - : t("booking_submitted") - : isCancelled - ? seatReferenceUid - ? t("no_longer_attending") - : t("event_cancelled") - : isBookingInPast - ? t("event_expired") - : props.recurringBookings - ? t("meeting_is_scheduled_recurring") - : t("meeting_is_scheduled")} + {successPageHeadline}

{getTitle()}

diff --git a/packages/features/calendars/DatePicker.tsx b/packages/features/calendars/DatePicker.tsx index 728a3ea301..1a46fdac54 100644 --- a/packages/features/calendars/DatePicker.tsx +++ b/packages/features/calendars/DatePicker.tsx @@ -129,16 +129,6 @@ const NoAvailabilityOverlay = ({ ); }; -const ReschedulingNotPossibleOverlay = () => { - const { t } = useLocale(); - - return ( -
-

{t("rescheduling_not_possible")}

-
- ); -}; - const Days = ({ minDate, excludedDates = [], @@ -291,8 +281,6 @@ const Days = ({
))} - {isBookingInPast && } - {!props.isPending && !isBookingInPast && includedDates && includedDates?.length === 0 && ( )} @@ -374,13 +362,11 @@ const DatePicker = ({