From 99e9425257f7c5ea776e7788e2c095ed05c1aa56 Mon Sep 17 00:00:00 2001 From: Anik Dhabal Babu <81948346+anikdhabal@users.noreply.github.com> Date: Sat, 12 Aug 2023 05:09:25 +0530 Subject: [PATCH] fix: RTL issues on booking pages + email confirmation (#10526) Co-authored-by: Peer Richelsen --- apps/web/pages/booking/[uid].tsx | 6 +- packages/emails/templates/confirm-email.html | 64 +++++++++++++++++++ packages/features/bookings/Booker/Booker.tsx | 4 +- .../bookings/Booker/components/EventMeta.tsx | 2 +- .../bookings/Booker/components/Header.tsx | 22 ++++--- .../bookings/components/AvailableTimes.tsx | 2 +- .../event-meta/AvailableEventLocations.tsx | 2 +- .../components/event-meta/Details.tsx | 6 +- packages/features/calendars/DatePicker.tsx | 4 +- .../components/DateValues/index.tsx | 11 +++- .../components/horizontalLines/index.tsx | 4 +- .../components/verticalLines/index.tsx | 16 ++++- packages/ui/components/alert/Alert.tsx | 2 +- .../form/toggleGroup/ToggleGroup.tsx | 2 +- 14 files changed, 115 insertions(+), 32 deletions(-) diff --git a/apps/web/pages/booking/[uid].tsx b/apps/web/pages/booking/[uid].tsx index 04de58e60e..e7002ae6e4 100644 --- a/apps/web/pages/booking/[uid].tsx +++ b/apps/web/pages/booking/[uid].tsx @@ -314,7 +314,7 @@ export default function Success(props: SuccessProps) { - {t("back_to_bookings")} + {t("back_to_bookings")} )} @@ -394,7 +394,7 @@ export default function Success(props: SuccessProps) { )} -
+
{(isCancelled || reschedule) && cancellationReason && ( <>
@@ -715,7 +715,7 @@ export default function Success(props: SuccessProps) {
{isGmail && ( diff --git a/packages/emails/templates/confirm-email.html b/packages/emails/templates/confirm-email.html index fbb80b1838..3b47e17e3b 100644 --- a/packages/emails/templates/confirm-email.html +++ b/packages/emails/templates/confirm-email.html @@ -497,6 +497,70 @@
+ + +
+ + + + + + +
+ + + + + + +
+ + + +
+
+
+ + diff --git a/packages/features/bookings/Booker/Booker.tsx b/packages/features/bookings/Booker/Booker.tsx index 155149ab5b..a5f183cc3a 100644 --- a/packages/features/bookings/Booker/Booker.tsx +++ b/packages/features/bookings/Booker/Booker.tsx @@ -207,7 +207,7 @@ const BookerComponent = ({ @@ -280,7 +280,7 @@ const BookerComponent = ({ layout === BookerLayouts.COLUMN_VIEW } className={classNames( - "border-subtle flex h-full w-full flex-col px-5 py-3 pb-0 md:border-l", + "border-subtle rtl:border-default flex h-full w-full flex-col px-5 py-3 pb-0 rtl:border-r ltr:md:border-l", layout === BookerLayouts.MONTH_VIEW && "scroll-bar h-full overflow-auto md:w-[var(--booker-timeslots-width)]", layout !== BookerLayouts.MONTH_VIEW && "sticky top-0" diff --git a/packages/features/bookings/Booker/components/EventMeta.tsx b/packages/features/bookings/Booker/components/EventMeta.tsx index d89044ed0a..ac6cd09305 100644 --- a/packages/features/bookings/Booker/components/EventMeta.tsx +++ b/packages/features/bookings/Booker/components/EventMeta.tsx @@ -71,7 +71,7 @@ export const EventMeta = () => {
)} -
+
{rescheduleUid && bookingData && ( {t("former_time")} diff --git a/packages/features/bookings/Booker/components/Header.tsx b/packages/features/bookings/Booker/components/Header.tsx index 4220c43060..b6d38722e8 100644 --- a/packages/features/bookings/Booker/components/Header.tsx +++ b/packages/features/bookings/Booker/components/Header.tsx @@ -21,7 +21,7 @@ export function Header({ isMobile: boolean; enabledLayouts: BookerLayouts[]; }) { - const { t } = useLocale(); + const { t, i18n } = useLocale(); const [layout, setLayout] = useBookerStore((state) => [state.layout, state.setLayout], shallow); const selectedDateString = useBookerStore((state) => state.selectedDate); const setSelectedDate = useBookerStore((state) => state.setSelectedDate); @@ -66,13 +66,13 @@ export function Header({ const isSameYear = () => { return selectedDate.format("YYYY") === endDate.format("YYYY"); }; - + const formattedMonth = new Intl.DateTimeFormat(i18n.language, { month: "short" }); const FormattedSelectedDateRange = () => { return (

- {selectedDate.format("MMM D")} + {formattedMonth.format(selectedDate.toDate())} {selectedDate.format("D")} {!isSameYear() && , {selectedDate.format("YYYY")} }-{" "} - {isSameMonth() ? endDate.format("D") : endDate.format("MMM D")},{" "} + {!isSameMonth() && formattedMonth.format(endDate.toDate())} {endDate.format("D")},{" "} {isSameYear() ? selectedDate.format("YYYY") : endDate.format("YYYY")} @@ -81,11 +81,12 @@ export function Header({ }; return ( -
-
+
+
-
+
{/* This second layout toggle is hidden, but needed to reserve the correct spot in the DIV for the fixed toggle above to fit into. If we wouldn't make it fixed in this view, the transition would be really weird, because the element is positioned fixed in the month view, and then - when switching layouts wouldn't anymmore, causing it to animate from the center to the top right, - while it actuall already was on place. That's why we have this element twice. + when switching layouts wouldn't anymore, causing it to animate from the center to the top right, + while it actually already was on place. That's why we have this element twice. */}
diff --git a/packages/features/bookings/components/AvailableTimes.tsx b/packages/features/bookings/components/AvailableTimes.tsx index 539f0a489d..ed80ad0b31 100644 --- a/packages/features/bookings/components/AvailableTimes.tsx +++ b/packages/features/bookings/components/AvailableTimes.tsx @@ -69,7 +69,7 @@ export const AvailableTimes = ({ {showTimeFormatToggle && ( -
+
)} diff --git a/packages/features/bookings/components/event-meta/AvailableEventLocations.tsx b/packages/features/bookings/components/event-meta/AvailableEventLocations.tsx index e0c8467275..a3ee446b6d 100644 --- a/packages/features/bookings/components/event-meta/AvailableEventLocations.tsx +++ b/packages/features/bookings/components/event-meta/AvailableEventLocations.tsx @@ -112,7 +112,7 @@ export function AvailableEventLocations({ locations }: { locations: LocationObje
) : filteredLocations.length === 1 ? ( -
+
{filteredLocations}
) : null; diff --git a/packages/features/bookings/components/event-meta/Details.tsx b/packages/features/bookings/components/event-meta/Details.tsx index 997bfeaadd..c5eaddc6b4 100644 --- a/packages/features/bookings/components/event-meta/Details.tsx +++ b/packages/features/bookings/components/event-meta/Details.tsx @@ -86,7 +86,7 @@ export const EventMetaBlock = ({ )} /> ) : ( - <>{!!Icon && } + <>{!!Icon && } )}
{children}
@@ -128,9 +128,9 @@ export const EventDetails = ({ event, blocks = defaultEventDetailsBlocks }: Even case EventDetailBlocks.LOCATION: if (!event?.locations?.length) return null; return ( - + - + ); case EventDetailBlocks.REQUIRES_CONFIRMATION: diff --git a/packages/features/calendars/DatePicker.tsx b/packages/features/calendars/DatePicker.tsx index 6a8c7c973d..10d708c0bc 100644 --- a/packages/features/calendars/DatePicker.tsx +++ b/packages/features/calendars/DatePicker.tsx @@ -241,7 +241,7 @@ const DatePicker = ({