Merged in fix/bw-fixes (pull request #3481)

Fix/bw fixes

* fix(bookingwidget): fixed some mobile issues with the booking widget

* fixed dual scroll and hidden button in mobile guests & rooms picker

* fixed button colors

* fixed mobile search button position

* Remove scroll lock
This commit is contained in:
Linus Flood
2026-01-23 08:05:49 +00:00
parent 64d81c6ede
commit ec78befb50
8 changed files with 9 additions and 29 deletions

View File

@@ -62,6 +62,9 @@
color: var(--Text-Interactive-Focus); color: var(--Text-Interactive-Focus);
} }
@media screen and (max-width: 767px) { @media screen and (max-width: 767px) {
.buttonContainer {
margin-bottom: var(--Space-x6);
}
.voucherContainer { .voucherContainer {
padding: var(--Space-x15) 0 var(--Space-x4); padding: var(--Space-x15) 0 var(--Space-x4);
} }

View File

@@ -131,7 +131,7 @@ export default function DatePickerRangeMobile({
<footer className={styles.footer}> <footer className={styles.footer}>
<Button <Button
className={styles.button} className={styles.button}
variant="Primary" variant="Tertiary"
color="Primary" color="Primary"
size="md" size="md"
onPress={close} onPress={close}

View File

@@ -81,7 +81,6 @@ div.months {
#ffffff 82.5% #ffffff 82.5%
); );
display: flex; display: flex;
grid-area: content;
padding: var(--Space-x1) var(--Space-x2) var(--Space-x7); padding: var(--Space-x1) var(--Space-x2) var(--Space-x7);
position: fixed; position: fixed;
bottom: 0; bottom: 0;

View File

@@ -8,7 +8,6 @@ import { useMediaQuery } from "usehooks-ts"
import { longDateFormat } from "@scandic-hotels/common/constants/dateFormats" import { longDateFormat } from "@scandic-hotels/common/constants/dateFormats"
import { dt } from "@scandic-hotels/common/dt" import { dt } from "@scandic-hotels/common/dt"
import { useScrollLock } from "@scandic-hotels/common/hooks/useScrollLock"
import { Typography } from "@scandic-hotels/design-system/Typography" import { Typography } from "@scandic-hotels/design-system/Typography"
import useLang from "../../../hooks/useLang" import useLang from "../../../hooks/useLang"
@@ -31,9 +30,6 @@ export default function DatePickerForm({
const checkIsDesktop = useMediaQuery("(min-width: 1367px)") const checkIsDesktop = useMediaQuery("(min-width: 1367px)")
const [isDesktop, setIsDesktop] = useState(true) const [isDesktop, setIsDesktop] = useState(true)
const { lockScroll, unlockScroll } = useScrollLock({
autoLock: false,
})
const [isOpen, setIsOpen] = useState(false) const [isOpen, setIsOpen] = useState(false)
const selectedDate = useWatch({ name }) const selectedDate = useWatch({ name })
const { setValue } = useFormContext() const { setValue } = useFormContext()
@@ -50,8 +46,7 @@ export default function DatePickerForm({
) )
} }
setIsOpen(false) setIsOpen(false)
unlockScroll() }, [name, setValue, selectedDate])
}, [name, setValue, selectedDate, unlockScroll])
const { overlayProps, underlayProps } = useOverlay( const { overlayProps, underlayProps } = useOverlay(
{ {
@@ -168,11 +163,6 @@ export default function DatePickerForm({
ariaLabelledBy={ariaLabelledBy} ariaLabelledBy={ariaLabelledBy}
onPress={() => { onPress={() => {
setIsOpen((prev) => !prev) setIsOpen((prev) => !prev)
if (!isOpen) {
lockScroll()
} else {
unlockScroll()
}
}} }}
selectedFromDate={selectedFromDate} selectedFromDate={selectedFromDate}
selectedToDate={selectedToDate} selectedToDate={selectedToDate}

View File

@@ -187,7 +187,7 @@ export default function GuestsRoomsPickerDialog({
onPress={handleClose} onPress={handleClose}
isDisabled={isInvalid} isDisabled={isInvalid}
className={styles.doneButton} className={styles.doneButton}
variant={isDesktop ? "Tertiary" : "Primary"} variant="Tertiary"
color="Primary" color="Primary"
size={isDesktop ? "sm" : "md"} size={isDesktop ? "sm" : "md"}
> >

View File

@@ -115,13 +115,13 @@
grid-area: content; grid-area: content;
overflow-y: scroll; overflow-y: scroll;
scroll-snap-type: y mandatory; scroll-snap-type: y mandatory;
padding-bottom: calc(120px + var(--Space-x2)); padding-bottom: calc(var(--sticky-button-height) + var(--Space-x4));
} }
.header { .header {
display: grid; display: grid;
grid-area: header; grid-area: header;
padding: var(--Space-x3) var(--Space-x2) 0; padding: 0 var(--Space-x2) 0;
} }
.close { .close {

View File

@@ -7,7 +7,6 @@ import { useFormContext, useWatch } from "react-hook-form"
import { useIntl } from "react-intl" import { useIntl } from "react-intl"
import { useMediaQuery } from "usehooks-ts" import { useMediaQuery } from "usehooks-ts"
import { useScrollLock } from "@scandic-hotels/common/hooks/useScrollLock"
import { Typography } from "@scandic-hotels/design-system/Typography" import { Typography } from "@scandic-hotels/design-system/Typography"
import ValidationError from "./ValidationError/index" import ValidationError from "./ValidationError/index"
@@ -40,9 +39,6 @@ export default function GuestsRoomsPickerForm({
const [scrollPosition, setScrollPosition] = useState(0) const [scrollPosition, setScrollPosition] = useState(0)
const roomError = errors["rooms"] const roomError = errors["rooms"]
const { lockScroll, unlockScroll } = useScrollLock({
autoLock: false,
})
useEffect(() => { useEffect(() => {
if (roomError) { if (roomError) {
setShowErrorModal(true) setShowErrorModal(true)
@@ -136,7 +132,6 @@ export default function GuestsRoomsPickerForm({
isOpen, isOpen,
onClose: () => { onClose: () => {
setIsOpen(false) setIsOpen(false)
unlockScroll()
}, },
isDismissable: true, isDismissable: true,
}, },
@@ -150,11 +145,6 @@ export default function GuestsRoomsPickerForm({
rooms={rooms} rooms={rooms}
onPress={() => { onPress={() => {
setIsOpen((prev) => !prev) setIsOpen((prev) => !prev)
if (!isDesktop && !isOpen) {
lockScroll()
} else {
unlockScroll()
}
}} }}
ariaLabelledBy={ariaLabelledBy} ariaLabelledBy={ariaLabelledBy}
/> />
@@ -181,7 +171,6 @@ export default function GuestsRoomsPickerForm({
rooms={rooms} rooms={rooms}
onClose={() => { onClose={() => {
setIsOpen((prev) => !prev) setIsOpen((prev) => !prev)
unlockScroll()
}} }}
containerRef={ref} containerRef={ref}
/> />

View File

@@ -40,11 +40,10 @@
gap: var(--Space-x3); gap: var(--Space-x3);
height: calc(100dvh - max(var(--sitewide-alert-sticky-height), 20px)); height: calc(100dvh - max(var(--sitewide-alert-sticky-height), 20px));
width: 100%; width: 100%;
padding: var(--Space-x3) var(--Space-x2); padding: var(--Space-x3) var(--Space-x2) 0;
position: fixed; position: fixed;
left: 0; left: 0;
bottom: 0; bottom: 0;
overflow-y: auto;
transform: translateY(100%); transform: translateY(100%);
transition: transform 300ms ease; transition: transform 300ms ease;
visibility: hidden; visibility: hidden;