feat: adjust select rate ui to latest design
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user