From 665ca210c0e21fdd3ae268b044a75ddfa096dc23 Mon Sep 17 00:00:00 2001 From: Matilda Haneling Date: Thu, 22 Jan 2026 12:50:24 +0000 Subject: [PATCH] Merged in fix/book-149-ui-fixes (pull request #3463) Fix/book 149 ui fixes * fixed text-overflow issue in datepicker trigger * fixed X missing in booking code text field * fixed toDate not setting properly * fixed spacing issues and placeholder text not fitting * added error message to child age if none is added * spacing fixes * Revert "map link alignment fix" This reverts commit d38cc5b007bc05a1d48ce6661b1052fe714961c3. * fixed EB points padding issue on SAS tablet * maxWidth on BookingCode/voucher * spacing fixes * fixed icons in error message * spacing fixes * scroll to child age picker updates * feat(SW-3706): fix heatmap issue for langswitcher and booking widget * fixed tablet lineup issue Approved-by: Linus Flood --- .../languageSwitcher.module.css | 2 + .../BookingCode/BookingCodeError/index.tsx | 10 +--- .../BookingCode/booking-code.module.css | 4 ++ .../FormContent/BookingCode/index.tsx | 4 +- .../RewardNight/reward-night.module.css | 5 +- .../FormContent/Search/search.module.css | 2 +- .../FormContent/ValidationError/index.tsx | 7 ++- .../FormContent/Voucher/voucher.module.css | 5 +- .../FormContent/formContent.module.css | 14 ++++-- .../BookingWidget/DatePicker/index.tsx | 3 +- .../ChildSelector/ChildInfoSelector.tsx | 23 +++++++-- .../GuestsRoomsPicker/ChildSelector/index.tsx | 49 +++++++++++++++---- .../BookingWidget/GuestsRoomsPicker/Form.tsx | 3 ++ .../GuestsRoomsPicker/GuestsRoom/index.tsx | 5 ++ .../ValidationError/index.tsx | 7 ++- .../guests-rooms-picker.module.css | 2 +- .../BookingWidget/GuestsRoomsPicker/index.tsx | 5 +- .../BookingWidget/bookingWidget.module.css | 18 ++++++- .../selectHotelMapContent.module.css | 2 +- 19 files changed, 129 insertions(+), 41 deletions(-) diff --git a/apps/scandic-web/components/LanguageSwitcher/languageSwitcher.module.css b/apps/scandic-web/components/LanguageSwitcher/languageSwitcher.module.css index a455d5274..d5aa86903 100644 --- a/apps/scandic-web/components/LanguageSwitcher/languageSwitcher.module.css +++ b/apps/scandic-web/components/LanguageSwitcher/languageSwitcher.module.css @@ -70,10 +70,12 @@ left: 0; bottom: 0; transform: translateY(100%); + visibility: hidden; } .footer .dropdown.isExpanded { transform: translateY(0); + visibility: visible; } @media screen and (max-width: 767px) { diff --git a/packages/booking-flow/lib/components/BookingWidget/BookingWidgetForm/FormContent/BookingCode/BookingCodeError/index.tsx b/packages/booking-flow/lib/components/BookingWidget/BookingWidgetForm/FormContent/BookingCode/BookingCodeError/index.tsx index 2959d03dc..09f28dd17 100644 --- a/packages/booking-flow/lib/components/BookingWidget/BookingWidgetForm/FormContent/BookingCode/BookingCodeError/index.tsx +++ b/packages/booking-flow/lib/components/BookingWidget/BookingWidgetForm/FormContent/BookingCode/BookingCodeError/index.tsx @@ -11,13 +11,7 @@ import { isMultiRoomError } from "../../utils" import styles from "./booking-code-error.module.css" -export function BookingCodeError({ - codeError, - isDesktop = false, -}: { - codeError: FieldError - isDesktop?: boolean -}) { +export function BookingCodeError({ codeError }: { codeError: FieldError }) { const intl = useIntl() const isMultiroomError = isMultiRoomError(codeError.message) const config = useBookingFlowConfig() @@ -33,7 +27,7 @@ export function BookingCodeError({ size={20} icon="error" color="Icon/Feedback/Error" - isFilled={!isDesktop} + isFilled /> {getErrorMessage(intl, config.variant, codeError.message)} diff --git a/packages/booking-flow/lib/components/BookingWidget/BookingWidgetForm/FormContent/BookingCode/booking-code.module.css b/packages/booking-flow/lib/components/BookingWidget/BookingWidgetForm/FormContent/BookingCode/booking-code.module.css index ddc94090c..53ae23054 100644 --- a/packages/booking-flow/lib/components/BookingWidget/BookingWidgetForm/FormContent/BookingCode/booking-code.module.css +++ b/packages/booking-flow/lib/components/BookingWidget/BookingWidgetForm/FormContent/BookingCode/booking-code.module.css @@ -11,6 +11,7 @@ border-radius: var(--Corner-Radius-md); padding: var(--Space-x1) var(--Space-x15); border: 2px solid transparent; + flex-shrink: 0; } .bookingCode:focus-within, @@ -27,6 +28,9 @@ gap: var(--Space-x05); position: relative; color: var(--Text-Secondary); + flex-shrink: 0; + text-wrap: nowrap; + width: 100%; } .input { diff --git a/packages/booking-flow/lib/components/BookingWidget/BookingWidgetForm/FormContent/BookingCode/index.tsx b/packages/booking-flow/lib/components/BookingWidget/BookingWidgetForm/FormContent/BookingCode/index.tsx index ae11c3698..51db6e0ff 100644 --- a/packages/booking-flow/lib/components/BookingWidget/BookingWidgetForm/FormContent/BookingCode/index.tsx +++ b/packages/booking-flow/lib/components/BookingWidget/BookingWidgetForm/FormContent/BookingCode/index.tsx @@ -167,7 +167,7 @@ export default function BookingCode() { {codeError?.message ? ( - + ) : ( - + {intl.formatMessage({ id: "bookingWidget.validationError.destination", defaultMessage: "Enter destination or hotel", diff --git a/packages/booking-flow/lib/components/BookingWidget/BookingWidgetForm/FormContent/Voucher/voucher.module.css b/packages/booking-flow/lib/components/BookingWidget/BookingWidgetForm/FormContent/Voucher/voucher.module.css index f135cc120..508352b3a 100644 --- a/packages/booking-flow/lib/components/BookingWidget/BookingWidgetForm/FormContent/Voucher/voucher.module.css +++ b/packages/booking-flow/lib/components/BookingWidget/BookingWidgetForm/FormContent/Voucher/voucher.module.css @@ -43,7 +43,7 @@ .optionsContainer { display: grid; grid-template-columns: auto auto; - column-gap: var(--Space-x2); + column-gap: var(--Space-x3); } } @@ -54,6 +54,9 @@ .showOnTablet { display: flex; } + .option { + min-height: 56px; + } .skeletonContainer { padding: var(--Space-x2) 0; } diff --git a/packages/booking-flow/lib/components/BookingWidget/BookingWidgetForm/FormContent/formContent.module.css b/packages/booking-flow/lib/components/BookingWidget/BookingWidgetForm/FormContent/formContent.module.css index 568efe1a1..083262b7a 100644 --- a/packages/booking-flow/lib/components/BookingWidget/BookingWidgetForm/FormContent/formContent.module.css +++ b/packages/booking-flow/lib/components/BookingWidget/BookingWidgetForm/FormContent/formContent.module.css @@ -63,7 +63,7 @@ } @media screen and (max-width: 767px) { .voucherContainer { - padding: var(--Space-x2) 0 var(--Space-x4); + padding: var(--Space-x15) 0 var(--Space-x4); } .buttonContainer { width: 100%; @@ -73,7 +73,7 @@ @media screen and (max-width: 1366px) { .inputContainer { display: grid; - gap: var(--Space-x2); + gap: var(--Space-x15); } .rooms, @@ -111,7 +111,7 @@ .inputContainer { display: flex; flex: 2; - gap: var(--Space-x2); + gap: var(--Space-x15); } .voucherContainer { border-radius: 0 0 var(--Corner-Radius-md) var(--Corner-Radius-md); @@ -191,12 +191,18 @@ } @media screen and (min-width: 1367px) { + .inputContainer { + margin-left: calc(-1 * var(--Space-x15)); + } .input { - gap: var(--Space-x2); + gap: var(--Space-x15); } .inputRow { flex: 1; } + .voucherRow { + flex: 0 1; + } .bookingCodeDisabled { flex: none; diff --git a/packages/booking-flow/lib/components/BookingWidget/DatePicker/index.tsx b/packages/booking-flow/lib/components/BookingWidget/DatePicker/index.tsx index 1f5030dac..9b9d705a3 100644 --- a/packages/booking-flow/lib/components/BookingWidget/DatePicker/index.tsx +++ b/packages/booking-flow/lib/components/BookingWidget/DatePicker/index.tsx @@ -57,8 +57,7 @@ export default function DatePickerForm({ { isOpen, onClose: () => { - setIsOpen(false) - unlockScroll() + close() }, isDismissable: true, }, diff --git a/packages/booking-flow/lib/components/BookingWidget/GuestsRoomsPicker/ChildSelector/ChildInfoSelector.tsx b/packages/booking-flow/lib/components/BookingWidget/GuestsRoomsPicker/ChildSelector/ChildInfoSelector.tsx index d14b16348..ef285623a 100644 --- a/packages/booking-flow/lib/components/BookingWidget/GuestsRoomsPicker/ChildSelector/ChildInfoSelector.tsx +++ b/packages/booking-flow/lib/components/BookingWidget/GuestsRoomsPicker/ChildSelector/ChildInfoSelector.tsx @@ -30,6 +30,7 @@ type ChildInfoSelectorProps = { index: number roomIndex: number childrenInAdultsBed: number + scrollToRef?: React.Ref } export default function ChildInfoSelector({ @@ -38,6 +39,7 @@ export default function ChildInfoSelector({ adults, index = 0, roomIndex = 0, + scrollToRef, }: ChildInfoSelectorProps) { const ageSelectRef = useRef(null) const bedPrefSelectRef = useRef(null) @@ -84,8 +86,11 @@ export default function ChildInfoSelector({ defaultMessage: "Child age is required", }) - const { setValue, formState } = useFormContext() + const { setValue, formState, watch } = useFormContext() + const selectedAgeValue = watch( + `rooms.${roomIndex}.childrenInRoom.${index}.age` + ) function updateSelectedBed(bed: number) { setValue(`rooms.${roomIndex}.childrenInRoom.${index}.bed`, bed) } @@ -140,10 +145,16 @@ export default function ChildInfoSelector({ const ageError = roomErrors?.age const bedError = roomErrors?.bed + const isInvalid = + !!ageError || + !!bedError || + selectedAgeValue === undefined || + selectedAgeValue === null || + selectedAgeValue === -1 return ( <> -
+