Merged in feat/SW-2703-mobile-summary-improvements (pull request #2060)

Feat/SW-2703 mobile price summary improvements

* feat(SW-2703): fixes to select rate price summary

* feat(SW-2703): fixes enter details summary mobile

* fix: z-index issue related to booking widget popover

* fix

* fix: added accessibility props to overlay div

* fix: added button inside header

* fix: rename aria button


Approved-by: Michael Zetterberg
This commit is contained in:
Tobias Johansson
2025-05-13 09:22:34 +00:00
parent 19166ec5c7
commit 13261d425c
13 changed files with 178 additions and 108 deletions

View File

@@ -32,6 +32,8 @@
.wrapper[data-open="true"] {
grid-template-rows: 1fr 7.5em;
position: relative;
z-index: var(--default-modal-z-index);
}
.wrapper[data-open="true"] .bottomSheet {

View File

@@ -12,8 +12,11 @@ import styles from "./mobile.module.css"
import type { SummaryProps } from "@/types/components/hotelReservation/summary"
export default function MobileSummary({ isMember }: SummaryProps) {
const toggleSummaryOpen = useEnterDetailsStore(
(state) => state.actions.toggleSummaryOpen
const { isSummaryOpen, toggleSummaryOpen } = useEnterDetailsStore(
(state) => ({
isSummaryOpen: state.isSummaryOpen,
toggleSummaryOpen: state.actions.toggleSummaryOpen,
})
)
const { booking, rooms, totalPrice, vat } = useEnterDetailsStore((state) => ({
@@ -31,7 +34,21 @@ export default function MobileSummary({ isMember }: SummaryProps) {
return (
<div className={styles.mobileSummary}>
{showPromo ? <SignupPromoMobile /> : null}
{showPromo ? (
<div className={styles.signupPromoWrapper}>
<SignupPromoMobile />
</div>
) : null}
{isSummaryOpen && (
<div
className={styles.overlay}
role="presentation"
aria-hidden="true"
onClick={toggleSummaryOpen}
/>
)}
<SummaryBottomSheet>
<div className={styles.wrapper}>
<SummaryUI

View File

@@ -9,7 +9,21 @@
border-style: solid;
border-width: 1px;
border-bottom: none;
z-index: 10;
}
.signupPromoWrapper {
position: relative;
z-index: var(--default-modal-z-index);
}
.overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: var(--Overlay-40);
z-index: var(--default-modal-overlay-z-index);
}
}

View File

@@ -4,7 +4,6 @@ import { Fragment } from "react"
import { useIntl } from "react-intl"
import { Button } from "@scandic-hotels/design-system/Button"
import { IconButton } from "@scandic-hotels/design-system/IconButton"
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
import { dt } from "@/lib/dt"
@@ -104,7 +103,11 @@ export default function SummaryUI({
return (
<section className={styles.summary}>
<header className={styles.header}>
<header
className={styles.header}
role="button"
onClick={handleToggleSummary}
>
<Subtitle className={styles.title} type="two">
{intl.formatMessage({
defaultMessage: "Booking summary",
@@ -120,18 +123,12 @@ export default function SummaryUI({
{/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */}
{dt(booking.toDate).locale(lang).format("ddd, D MMM")} ({nightsMsg})
</Body>
<IconButton
onPress={handleToggleSummary}
className={styles.chevronButton}
theme="Black"
style="Muted"
>
<MaterialIcon
icon="keyboard_arrow_down"
size={20}
color="CurrentColor"
/>
</IconButton>
<MaterialIcon
className={styles.chevronIcon}
icon="keyboard_arrow_down"
size={30}
color="CurrentColor"
/>
</header>
<Divider color="primaryLightSubtle" />
{rooms.map(({ room }, idx) => {

View File

@@ -9,18 +9,17 @@
.header {
display: grid;
grid-template-areas: "title button" "date button";
grid-template-areas: "title button" "date date";
grid-template-columns: 1fr auto;
align-items: center;
}
.title {
grid-area: title;
}
.chevronButton {
.chevronIcon {
grid-area: button;
justify-self: end;
align-items: center;
margin-right: calc(0px - var(--Spacing-x2));
}
.date {