feat: adjust select rate ui to latest design

This commit is contained in:
Simon Emanuelsson
2025-02-17 15:10:48 +01:00
parent 2c72957dc6
commit 4c23700d52
76 changed files with 819 additions and 654 deletions

View File

@@ -120,6 +120,19 @@ export function createRatesStore({
return create<RatesState>()((set) => ({
actions: {
closeSection(idx) {
return function () {
return set(
produce((state: RatesState) => {
if (state.rateSummary.length === state.booking.rooms.length) {
state.activeRoom = -1
} else {
state.activeRoom = idx + 1
}
})
)
}
},
modifyRate(idx) {
return function () {
return set(
@@ -201,10 +214,11 @@ export function createRatesStore({
selectedRate.roomTypeCode
)
state.activeRoom =
idx + 1 < state.booking.rooms.length
? idx + 1
: state.booking.rooms.length
if (state.rateSummary.length === state.booking.rooms.length) {
state.activeRoom = -1
} else {
state.activeRoom = idx + 1
}
state.searchParams = new ReadonlyURLSearchParams(searchParams)
window.history.pushState(