Merged in fix/SW-1715-price-details-with-many-rooms (pull request #1421)

Fix/SW-1715 price details with many rooms

* fix: added useMemo to stop combineRoomAvailabilities from rerunning

* fix: add max height and scroll to modal content

* fix: return new array in combineRoomAvailabilities instead of pushing


Approved-by: Christian Andolf
This commit is contained in:
Tobias Johansson
2025-02-27 12:55:07 +00:00
parent 92b81ab8e7
commit 832b6c27e0
2 changed files with 14 additions and 1 deletions

View File

@@ -11,7 +11,13 @@ export function combineRoomAvailabilities(
return availabilityResults.reduce<RoomsAvailability | null>((acc, result) => {
if (result.status === "fulfilled" && result.value) {
if (acc) {
acc.roomConfigurations.push(...result.value.roomConfigurations)
acc = {
...acc,
roomConfigurations: [
...acc.roomConfigurations,
...result.value.roomConfigurations,
],
}
} else {
acc = result.value
}

View File

@@ -29,6 +29,8 @@
/* for supporting animations within content */
position: relative;
overflow: hidden;
max-height: 100dvh;
}
.header {
@@ -48,6 +50,7 @@
align-items: center;
gap: var(--Spacing-x2);
padding: 0 var(--Spacing-x3) var(--Spacing-x4);
overflow: auto;
}
.close {
@@ -78,4 +81,8 @@
border-radius: var(--Corner-radius-Medium);
max-width: var(--max-width-page);
}
.dialog {
max-height: 90dvh;
}
}