@qite/tide-booking-component 1.4.33 → 1.4.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/build-cjs/index.js +48 -43
- package/build/build-esm/index.js +48 -43
- package/package.json +77 -77
- package/src/booking-product/components/product.tsx +26 -22
- package/src/booking-wizard/features/booking/booking-self-contained.tsx +304 -304
- package/src/qsm/components/QSMContainer/qsm-container.tsx +215 -218
- package/src/qsm/store/qsm-slice.ts +261 -261
- package/src/qsm/types.ts +145 -145
- package/src/search-results/components/search-results-container/search-results-container.tsx +341 -337
|
@@ -1,261 +1,261 @@
|
|
|
1
|
-
import { createSlice, PayloadAction } from '@reduxjs/toolkit';
|
|
2
|
-
|
|
3
|
-
import { MobileFilterType, Room, TravelerType, TravelType, TravelClass, TypeaheadOption } from '../types';
|
|
4
|
-
import { ReactNode } from 'react';
|
|
5
|
-
|
|
6
|
-
export interface QSMState {
|
|
7
|
-
selectedOrigin?: string;
|
|
8
|
-
selectedDestination?: string;
|
|
9
|
-
selectedAirport?: string;
|
|
10
|
-
fromDate?: string;
|
|
11
|
-
toDate?: string;
|
|
12
|
-
travelers: any[];
|
|
13
|
-
mobileFilterType: MobileFilterType;
|
|
14
|
-
searchResults: TypeaheadOption[];
|
|
15
|
-
activeSearchField: string | null;
|
|
16
|
-
activeSearchFieldProps: {
|
|
17
|
-
fieldKey: string;
|
|
18
|
-
label: string;
|
|
19
|
-
placeholder: string;
|
|
20
|
-
value: string;
|
|
21
|
-
options: TypeaheadOption[];
|
|
22
|
-
} | null;
|
|
23
|
-
mobileDatePickerMode: 'range' | 'single';
|
|
24
|
-
minDate?: string;
|
|
25
|
-
maxDate?: string;
|
|
26
|
-
dateFlexibility?: {
|
|
27
|
-
name: string;
|
|
28
|
-
before: number;
|
|
29
|
-
after: number;
|
|
30
|
-
}[];
|
|
31
|
-
datesIcon?: ReactNode;
|
|
32
|
-
selectedFlexRange?: { before: number; after: number };
|
|
33
|
-
travelTypes: TravelType[];
|
|
34
|
-
selectedTravelType?: string;
|
|
35
|
-
travelClasses: TravelClass[];
|
|
36
|
-
selectedTravelClass?: string;
|
|
37
|
-
selectedNationality?: string;
|
|
38
|
-
defaultTravelers: number;
|
|
39
|
-
maxTravelers: number;
|
|
40
|
-
maxChildAge: number;
|
|
41
|
-
maxInfantAge: number;
|
|
42
|
-
adults: number;
|
|
43
|
-
kids: number;
|
|
44
|
-
babies: number;
|
|
45
|
-
rooms: Room[];
|
|
46
|
-
[key: string]: any;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
const initialState: QSMState = {
|
|
50
|
-
selectedOrigin: undefined,
|
|
51
|
-
selectedDestination: undefined,
|
|
52
|
-
selectedAirport: undefined,
|
|
53
|
-
fromDate: undefined,
|
|
54
|
-
toDate: undefined,
|
|
55
|
-
travelers: [
|
|
56
|
-
{
|
|
57
|
-
adults: 2,
|
|
58
|
-
children: 0,
|
|
59
|
-
childrensAges: []
|
|
60
|
-
}
|
|
61
|
-
],
|
|
62
|
-
mobileFilterType: null,
|
|
63
|
-
activeSearchField: null,
|
|
64
|
-
activeSearchFieldProps: null,
|
|
65
|
-
searchResults: [],
|
|
66
|
-
mobileDatePickerMode: 'range',
|
|
67
|
-
minDate: undefined,
|
|
68
|
-
maxDate: undefined,
|
|
69
|
-
dateFlexibility: [],
|
|
70
|
-
datesIcon: undefined,
|
|
71
|
-
selectedFlexRange: undefined,
|
|
72
|
-
travelTypes: [],
|
|
73
|
-
selectedTravelType: undefined,
|
|
74
|
-
travelClasses: [],
|
|
75
|
-
selectedTravelClass: undefined,
|
|
76
|
-
selectedNationality: undefined,
|
|
77
|
-
defaultTravelers: 2,
|
|
78
|
-
maxTravelers: 9,
|
|
79
|
-
maxChildAge: 12,
|
|
80
|
-
maxInfantAge: 2,
|
|
81
|
-
adults: 2,
|
|
82
|
-
kids: 0,
|
|
83
|
-
babies: 0,
|
|
84
|
-
rooms: [{ adults: 2, kids: 0, babies: 0 }]
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
const qsmSlice = createSlice({
|
|
88
|
-
name: 'qsm',
|
|
89
|
-
initialState,
|
|
90
|
-
reducers: {
|
|
91
|
-
setOrigin: (state, action: PayloadAction<string>) => {
|
|
92
|
-
state.selectedOrigin = action.payload;
|
|
93
|
-
},
|
|
94
|
-
setDestination: (state, action: PayloadAction<string>) => {
|
|
95
|
-
state.selectedDestination = action.payload;
|
|
96
|
-
},
|
|
97
|
-
setAirport: (state, action: PayloadAction<string>) => {
|
|
98
|
-
state.selectedAirport = action.payload;
|
|
99
|
-
},
|
|
100
|
-
setFromDate: (state, action: PayloadAction<string | undefined>) => {
|
|
101
|
-
state.fromDate = action.payload;
|
|
102
|
-
},
|
|
103
|
-
setFieldValue: (
|
|
104
|
-
state,
|
|
105
|
-
action: PayloadAction<{
|
|
106
|
-
fieldKey: string;
|
|
107
|
-
value: any;
|
|
108
|
-
}>
|
|
109
|
-
) => {
|
|
110
|
-
const { fieldKey, value } = action.payload;
|
|
111
|
-
(state as any)[fieldKey] = value;
|
|
112
|
-
},
|
|
113
|
-
setToDate: (state, action: PayloadAction<string | undefined>) => {
|
|
114
|
-
state.toDate = action.payload;
|
|
115
|
-
},
|
|
116
|
-
setTravelers: (state, action: PayloadAction<any[]>) => {
|
|
117
|
-
state.travelers = action.payload;
|
|
118
|
-
},
|
|
119
|
-
setMobileFilterType: (state, action: PayloadAction<MobileFilterType>) => {
|
|
120
|
-
state.mobileFilterType = action.payload;
|
|
121
|
-
},
|
|
122
|
-
closeMobileFilter: (state) => {
|
|
123
|
-
state.mobileFilterType = null;
|
|
124
|
-
},
|
|
125
|
-
setActiveSearchField: (state, action: PayloadAction<string | null>) => {
|
|
126
|
-
state.activeSearchField = action.payload;
|
|
127
|
-
},
|
|
128
|
-
setActiveSearchFieldProps: (
|
|
129
|
-
state,
|
|
130
|
-
action: PayloadAction<{
|
|
131
|
-
fieldKey: string;
|
|
132
|
-
label: string;
|
|
133
|
-
placeholder: string;
|
|
134
|
-
value: string;
|
|
135
|
-
options: TypeaheadOption[];
|
|
136
|
-
}>
|
|
137
|
-
) => {
|
|
138
|
-
state.activeSearchFieldProps = action.payload;
|
|
139
|
-
},
|
|
140
|
-
setSearchResults: (state, action: PayloadAction<TypeaheadOption[]>) => {
|
|
141
|
-
state.searchResults = action.payload;
|
|
142
|
-
},
|
|
143
|
-
setMobileDatePickerMode: (state, action: PayloadAction<'range' | 'single'>) => {
|
|
144
|
-
state.mobileDatePickerMode = action.payload;
|
|
145
|
-
},
|
|
146
|
-
setMinDate: (state, action: PayloadAction<string | undefined>) => {
|
|
147
|
-
state.minDate = action.payload;
|
|
148
|
-
},
|
|
149
|
-
setMaxDate: (state, action: PayloadAction<string | undefined>) => {
|
|
150
|
-
state.maxDate = action.payload;
|
|
151
|
-
},
|
|
152
|
-
setDatesIcon: (state, action: PayloadAction<ReactNode | undefined>) => {
|
|
153
|
-
state.datesIcon = action.payload;
|
|
154
|
-
},
|
|
155
|
-
setDateFlexibility: (state, action: PayloadAction<QSMState['dateFlexibility']>) => {
|
|
156
|
-
state.dateFlexibility = action.payload;
|
|
157
|
-
},
|
|
158
|
-
setSelectedFlexRange: (state, action: PayloadAction<{ before: number; after: number } | undefined>) => {
|
|
159
|
-
state.selectedFlexRange = action.payload;
|
|
160
|
-
},
|
|
161
|
-
setTravelTypes: (state, action: PayloadAction<TravelType[]>) => {
|
|
162
|
-
state.travelTypes = action.payload;
|
|
163
|
-
},
|
|
164
|
-
setSelectedTravelType: (state, action) => {
|
|
165
|
-
state.selectedTravelType = action.payload;
|
|
166
|
-
},
|
|
167
|
-
setTravelClasses: (state, action: PayloadAction<TravelType[]>) => {
|
|
168
|
-
state.travelClasses = action.payload;
|
|
169
|
-
},
|
|
170
|
-
setSelectedTravelClass: (state, action) => {
|
|
171
|
-
state.selectedTravelClass = action.payload;
|
|
172
|
-
},
|
|
173
|
-
setSelectedNationality: (state, action) => {
|
|
174
|
-
state.selectedNationality = action.payload;
|
|
175
|
-
},
|
|
176
|
-
setDefaultTravelers: (state, action: PayloadAction<number>) => {
|
|
177
|
-
state.defaultTravelers = action.payload;
|
|
178
|
-
},
|
|
179
|
-
setMaxTravelers: (state, action: PayloadAction<number>) => {
|
|
180
|
-
state.maxTravelers = action.payload;
|
|
181
|
-
},
|
|
182
|
-
setMaxChildAge: (state, action: PayloadAction<number>) => {
|
|
183
|
-
state.maxChildAge = action.payload;
|
|
184
|
-
},
|
|
185
|
-
setMaxInfantAge: (state, action: PayloadAction<number>) => {
|
|
186
|
-
state.maxInfantAge = action.payload;
|
|
187
|
-
},
|
|
188
|
-
setAdults: (state, action) => {
|
|
189
|
-
state.adults = action.payload;
|
|
190
|
-
},
|
|
191
|
-
setKids: (state, action) => {
|
|
192
|
-
state.kids = action.payload;
|
|
193
|
-
},
|
|
194
|
-
setBabies: (state, action) => {
|
|
195
|
-
state.babies = action.payload;
|
|
196
|
-
},
|
|
197
|
-
setRooms: (state, action) => {
|
|
198
|
-
state.rooms = action.payload;
|
|
199
|
-
},
|
|
200
|
-
addRoom: (state) => {
|
|
201
|
-
if (state.rooms.length < 4) {
|
|
202
|
-
state.rooms.push({ adults: 2, kids: 0, babies: 0 });
|
|
203
|
-
}
|
|
204
|
-
},
|
|
205
|
-
removeRoom: (state, action) => {
|
|
206
|
-
const index = action.payload;
|
|
207
|
-
state.rooms.splice(index, 1);
|
|
208
|
-
},
|
|
209
|
-
updateRoomTraveler: (
|
|
210
|
-
state,
|
|
211
|
-
action: PayloadAction<{
|
|
212
|
-
roomIndex: number;
|
|
213
|
-
type: TravelerType;
|
|
214
|
-
value: number;
|
|
215
|
-
}>
|
|
216
|
-
) => {
|
|
217
|
-
const { roomIndex, type, value } = action.payload;
|
|
218
|
-
state.rooms[roomIndex][type] = value;
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
// more reducers as needed
|
|
222
|
-
}
|
|
223
|
-
});
|
|
224
|
-
|
|
225
|
-
export const {
|
|
226
|
-
setOrigin,
|
|
227
|
-
setDestination,
|
|
228
|
-
setAirport,
|
|
229
|
-
setFromDate,
|
|
230
|
-
setToDate,
|
|
231
|
-
setTravelers,
|
|
232
|
-
setMobileFilterType,
|
|
233
|
-
closeMobileFilter,
|
|
234
|
-
setActiveSearchField,
|
|
235
|
-
setActiveSearchFieldProps,
|
|
236
|
-
setSearchResults,
|
|
237
|
-
setMobileDatePickerMode,
|
|
238
|
-
setMinDate,
|
|
239
|
-
setMaxDate,
|
|
240
|
-
setDateFlexibility,
|
|
241
|
-
setSelectedFlexRange,
|
|
242
|
-
setTravelTypes,
|
|
243
|
-
setSelectedTravelType,
|
|
244
|
-
setTravelClasses,
|
|
245
|
-
setSelectedTravelClass,
|
|
246
|
-
setSelectedNationality,
|
|
247
|
-
setDefaultTravelers,
|
|
248
|
-
setMaxTravelers,
|
|
249
|
-
setMaxChildAge,
|
|
250
|
-
setAdults,
|
|
251
|
-
setKids,
|
|
252
|
-
setBabies,
|
|
253
|
-
setRooms,
|
|
254
|
-
addRoom,
|
|
255
|
-
removeRoom,
|
|
256
|
-
updateRoomTraveler,
|
|
257
|
-
setMaxInfantAge,
|
|
258
|
-
setDatesIcon,
|
|
259
|
-
setFieldValue
|
|
260
|
-
} = qsmSlice.actions;
|
|
261
|
-
export default qsmSlice.reducer;
|
|
1
|
+
import { createSlice, PayloadAction } from '@reduxjs/toolkit';
|
|
2
|
+
|
|
3
|
+
import { MobileFilterType, Room, TravelerType, TravelType, TravelClass, TypeaheadOption } from '../types';
|
|
4
|
+
import { ReactNode } from 'react';
|
|
5
|
+
|
|
6
|
+
export interface QSMState {
|
|
7
|
+
selectedOrigin?: string;
|
|
8
|
+
selectedDestination?: string;
|
|
9
|
+
selectedAirport?: string;
|
|
10
|
+
fromDate?: string;
|
|
11
|
+
toDate?: string;
|
|
12
|
+
travelers: any[];
|
|
13
|
+
mobileFilterType: MobileFilterType;
|
|
14
|
+
searchResults: TypeaheadOption[];
|
|
15
|
+
activeSearchField: string | null;
|
|
16
|
+
activeSearchFieldProps: {
|
|
17
|
+
fieldKey: string;
|
|
18
|
+
label: string;
|
|
19
|
+
placeholder: string;
|
|
20
|
+
value: string;
|
|
21
|
+
options: TypeaheadOption[];
|
|
22
|
+
} | null;
|
|
23
|
+
mobileDatePickerMode: 'range' | 'single';
|
|
24
|
+
minDate?: string;
|
|
25
|
+
maxDate?: string;
|
|
26
|
+
dateFlexibility?: {
|
|
27
|
+
name: string;
|
|
28
|
+
before: number;
|
|
29
|
+
after: number;
|
|
30
|
+
}[];
|
|
31
|
+
datesIcon?: ReactNode;
|
|
32
|
+
selectedFlexRange?: { before: number; after: number };
|
|
33
|
+
travelTypes: TravelType[];
|
|
34
|
+
selectedTravelType?: string;
|
|
35
|
+
travelClasses: TravelClass[];
|
|
36
|
+
selectedTravelClass?: string;
|
|
37
|
+
selectedNationality?: string;
|
|
38
|
+
defaultTravelers: number;
|
|
39
|
+
maxTravelers: number;
|
|
40
|
+
maxChildAge: number;
|
|
41
|
+
maxInfantAge: number;
|
|
42
|
+
adults: number;
|
|
43
|
+
kids: number;
|
|
44
|
+
babies: number;
|
|
45
|
+
rooms: Room[];
|
|
46
|
+
[key: string]: any;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const initialState: QSMState = {
|
|
50
|
+
selectedOrigin: undefined,
|
|
51
|
+
selectedDestination: undefined,
|
|
52
|
+
selectedAirport: undefined,
|
|
53
|
+
fromDate: undefined,
|
|
54
|
+
toDate: undefined,
|
|
55
|
+
travelers: [
|
|
56
|
+
{
|
|
57
|
+
adults: 2,
|
|
58
|
+
children: 0,
|
|
59
|
+
childrensAges: []
|
|
60
|
+
}
|
|
61
|
+
],
|
|
62
|
+
mobileFilterType: null,
|
|
63
|
+
activeSearchField: null,
|
|
64
|
+
activeSearchFieldProps: null,
|
|
65
|
+
searchResults: [],
|
|
66
|
+
mobileDatePickerMode: 'range',
|
|
67
|
+
minDate: undefined,
|
|
68
|
+
maxDate: undefined,
|
|
69
|
+
dateFlexibility: [],
|
|
70
|
+
datesIcon: undefined,
|
|
71
|
+
selectedFlexRange: undefined,
|
|
72
|
+
travelTypes: [],
|
|
73
|
+
selectedTravelType: undefined,
|
|
74
|
+
travelClasses: [],
|
|
75
|
+
selectedTravelClass: undefined,
|
|
76
|
+
selectedNationality: undefined,
|
|
77
|
+
defaultTravelers: 2,
|
|
78
|
+
maxTravelers: 9,
|
|
79
|
+
maxChildAge: 12,
|
|
80
|
+
maxInfantAge: 2,
|
|
81
|
+
adults: 2,
|
|
82
|
+
kids: 0,
|
|
83
|
+
babies: 0,
|
|
84
|
+
rooms: [{ adults: 2, kids: 0, babies: 0 }]
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
const qsmSlice = createSlice({
|
|
88
|
+
name: 'qsm',
|
|
89
|
+
initialState,
|
|
90
|
+
reducers: {
|
|
91
|
+
setOrigin: (state, action: PayloadAction<string>) => {
|
|
92
|
+
state.selectedOrigin = action.payload;
|
|
93
|
+
},
|
|
94
|
+
setDestination: (state, action: PayloadAction<string>) => {
|
|
95
|
+
state.selectedDestination = action.payload;
|
|
96
|
+
},
|
|
97
|
+
setAirport: (state, action: PayloadAction<string>) => {
|
|
98
|
+
state.selectedAirport = action.payload;
|
|
99
|
+
},
|
|
100
|
+
setFromDate: (state, action: PayloadAction<string | undefined>) => {
|
|
101
|
+
state.fromDate = action.payload;
|
|
102
|
+
},
|
|
103
|
+
setFieldValue: (
|
|
104
|
+
state,
|
|
105
|
+
action: PayloadAction<{
|
|
106
|
+
fieldKey: string;
|
|
107
|
+
value: any;
|
|
108
|
+
}>
|
|
109
|
+
) => {
|
|
110
|
+
const { fieldKey, value } = action.payload;
|
|
111
|
+
(state as any)[fieldKey] = value;
|
|
112
|
+
},
|
|
113
|
+
setToDate: (state, action: PayloadAction<string | undefined>) => {
|
|
114
|
+
state.toDate = action.payload;
|
|
115
|
+
},
|
|
116
|
+
setTravelers: (state, action: PayloadAction<any[]>) => {
|
|
117
|
+
state.travelers = action.payload;
|
|
118
|
+
},
|
|
119
|
+
setMobileFilterType: (state, action: PayloadAction<MobileFilterType>) => {
|
|
120
|
+
state.mobileFilterType = action.payload;
|
|
121
|
+
},
|
|
122
|
+
closeMobileFilter: (state) => {
|
|
123
|
+
state.mobileFilterType = null;
|
|
124
|
+
},
|
|
125
|
+
setActiveSearchField: (state, action: PayloadAction<string | null>) => {
|
|
126
|
+
state.activeSearchField = action.payload;
|
|
127
|
+
},
|
|
128
|
+
setActiveSearchFieldProps: (
|
|
129
|
+
state,
|
|
130
|
+
action: PayloadAction<{
|
|
131
|
+
fieldKey: string;
|
|
132
|
+
label: string;
|
|
133
|
+
placeholder: string;
|
|
134
|
+
value: string;
|
|
135
|
+
options: TypeaheadOption[];
|
|
136
|
+
}>
|
|
137
|
+
) => {
|
|
138
|
+
state.activeSearchFieldProps = action.payload;
|
|
139
|
+
},
|
|
140
|
+
setSearchResults: (state, action: PayloadAction<TypeaheadOption[]>) => {
|
|
141
|
+
state.searchResults = action.payload;
|
|
142
|
+
},
|
|
143
|
+
setMobileDatePickerMode: (state, action: PayloadAction<'range' | 'single'>) => {
|
|
144
|
+
state.mobileDatePickerMode = action.payload;
|
|
145
|
+
},
|
|
146
|
+
setMinDate: (state, action: PayloadAction<string | undefined>) => {
|
|
147
|
+
state.minDate = action.payload;
|
|
148
|
+
},
|
|
149
|
+
setMaxDate: (state, action: PayloadAction<string | undefined>) => {
|
|
150
|
+
state.maxDate = action.payload;
|
|
151
|
+
},
|
|
152
|
+
setDatesIcon: (state, action: PayloadAction<ReactNode | undefined>) => {
|
|
153
|
+
state.datesIcon = action.payload;
|
|
154
|
+
},
|
|
155
|
+
setDateFlexibility: (state, action: PayloadAction<QSMState['dateFlexibility']>) => {
|
|
156
|
+
state.dateFlexibility = action.payload;
|
|
157
|
+
},
|
|
158
|
+
setSelectedFlexRange: (state, action: PayloadAction<{ before: number; after: number } | undefined>) => {
|
|
159
|
+
state.selectedFlexRange = action.payload;
|
|
160
|
+
},
|
|
161
|
+
setTravelTypes: (state, action: PayloadAction<TravelType[]>) => {
|
|
162
|
+
state.travelTypes = action.payload;
|
|
163
|
+
},
|
|
164
|
+
setSelectedTravelType: (state, action) => {
|
|
165
|
+
state.selectedTravelType = action.payload;
|
|
166
|
+
},
|
|
167
|
+
setTravelClasses: (state, action: PayloadAction<TravelType[]>) => {
|
|
168
|
+
state.travelClasses = action.payload;
|
|
169
|
+
},
|
|
170
|
+
setSelectedTravelClass: (state, action) => {
|
|
171
|
+
state.selectedTravelClass = action.payload;
|
|
172
|
+
},
|
|
173
|
+
setSelectedNationality: (state, action) => {
|
|
174
|
+
state.selectedNationality = action.payload;
|
|
175
|
+
},
|
|
176
|
+
setDefaultTravelers: (state, action: PayloadAction<number>) => {
|
|
177
|
+
state.defaultTravelers = action.payload;
|
|
178
|
+
},
|
|
179
|
+
setMaxTravelers: (state, action: PayloadAction<number>) => {
|
|
180
|
+
state.maxTravelers = action.payload;
|
|
181
|
+
},
|
|
182
|
+
setMaxChildAge: (state, action: PayloadAction<number>) => {
|
|
183
|
+
state.maxChildAge = action.payload;
|
|
184
|
+
},
|
|
185
|
+
setMaxInfantAge: (state, action: PayloadAction<number>) => {
|
|
186
|
+
state.maxInfantAge = action.payload;
|
|
187
|
+
},
|
|
188
|
+
setAdults: (state, action) => {
|
|
189
|
+
state.adults = action.payload;
|
|
190
|
+
},
|
|
191
|
+
setKids: (state, action) => {
|
|
192
|
+
state.kids = action.payload;
|
|
193
|
+
},
|
|
194
|
+
setBabies: (state, action) => {
|
|
195
|
+
state.babies = action.payload;
|
|
196
|
+
},
|
|
197
|
+
setRooms: (state, action) => {
|
|
198
|
+
state.rooms = action.payload;
|
|
199
|
+
},
|
|
200
|
+
addRoom: (state) => {
|
|
201
|
+
if (state.rooms.length < 4) {
|
|
202
|
+
state.rooms.push({ adults: 2, kids: 0, babies: 0 });
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
removeRoom: (state, action) => {
|
|
206
|
+
const index = action.payload;
|
|
207
|
+
state.rooms.splice(index, 1);
|
|
208
|
+
},
|
|
209
|
+
updateRoomTraveler: (
|
|
210
|
+
state,
|
|
211
|
+
action: PayloadAction<{
|
|
212
|
+
roomIndex: number;
|
|
213
|
+
type: TravelerType;
|
|
214
|
+
value: number;
|
|
215
|
+
}>
|
|
216
|
+
) => {
|
|
217
|
+
const { roomIndex, type, value } = action.payload;
|
|
218
|
+
state.rooms[roomIndex][type] = value;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
// more reducers as needed
|
|
222
|
+
}
|
|
223
|
+
});
|
|
224
|
+
|
|
225
|
+
export const {
|
|
226
|
+
setOrigin,
|
|
227
|
+
setDestination,
|
|
228
|
+
setAirport,
|
|
229
|
+
setFromDate,
|
|
230
|
+
setToDate,
|
|
231
|
+
setTravelers,
|
|
232
|
+
setMobileFilterType,
|
|
233
|
+
closeMobileFilter,
|
|
234
|
+
setActiveSearchField,
|
|
235
|
+
setActiveSearchFieldProps,
|
|
236
|
+
setSearchResults,
|
|
237
|
+
setMobileDatePickerMode,
|
|
238
|
+
setMinDate,
|
|
239
|
+
setMaxDate,
|
|
240
|
+
setDateFlexibility,
|
|
241
|
+
setSelectedFlexRange,
|
|
242
|
+
setTravelTypes,
|
|
243
|
+
setSelectedTravelType,
|
|
244
|
+
setTravelClasses,
|
|
245
|
+
setSelectedTravelClass,
|
|
246
|
+
setSelectedNationality,
|
|
247
|
+
setDefaultTravelers,
|
|
248
|
+
setMaxTravelers,
|
|
249
|
+
setMaxChildAge,
|
|
250
|
+
setAdults,
|
|
251
|
+
setKids,
|
|
252
|
+
setBabies,
|
|
253
|
+
setRooms,
|
|
254
|
+
addRoom,
|
|
255
|
+
removeRoom,
|
|
256
|
+
updateRoomTraveler,
|
|
257
|
+
setMaxInfantAge,
|
|
258
|
+
setDatesIcon,
|
|
259
|
+
setFieldValue
|
|
260
|
+
} = qsmSlice.actions;
|
|
261
|
+
export default qsmSlice.reducer;
|