kupos-ui-components-lib 9.0.6 → 9.0.7
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/README copy.md +67 -223
- package/dist/assets/images/anims/service_list/directo.json +1 -1
- package/dist/assets/images/anims/service_list/priority_stage.json +1 -1
- package/dist/components/ServiceItem/RatingHover.js +31 -31
- package/dist/components/ServiceItem/ServiceItemDesktop.d.ts +1 -1
- package/dist/components/ServiceItem/ServiceItemDesktop.js +263 -125
- package/dist/components/ServiceItem/ServiceItemMobile.js +291 -44
- package/dist/components/ServiceItem/mobileTypes.d.ts +0 -3
- package/dist/components/ServiceItem/types.d.ts +0 -7
- package/dist/styles.css +17 -66
- package/dist/ui/AmenitiesBlock.js +36 -25
- package/dist/ui/DurationBlock.js +2 -2
- package/dist/ui/FlexibleBlock.js +4 -2
- package/dist/ui/PetBlock.js +3 -1
- package/dist/ui/RatingBlock.js +2 -6
- package/package.json +1 -1
- package/src/assets/images/anims/service_list/directo.json +1 -1
- package/src/assets/images/anims/service_list/priority_stage.json +1 -1
- package/src/components/ServiceItem/RatingHover.tsx +51 -51
- package/src/components/ServiceItem/ServiceItemDesktop.tsx +466 -222
- package/src/components/ServiceItem/ServiceItemMobile.tsx +501 -120
- package/src/components/ServiceItem/mobileTypes.ts +0 -3
- package/src/components/ServiceItem/types.ts +0 -7
- package/src/ui/AmenitiesBlock.tsx +15 -34
- package/src/ui/DurationBlock.tsx +2 -2
- package/src/ui/FlexibleBlock.tsx +3 -3
- package/src/ui/PetBlock.tsx +2 -2
- package/src/ui/RatingBlock.tsx +4 -16
- package/src/assets/images/anims/service_list/bomb.json +0 -1
- package/src/ui/BottomAmenities/BottomAmenities.tsx +0 -109
- package/src/ui/ExpendedDropDown/ExpandedDropdown.tsx +0 -85
- package/src/ui/KuposButton/KuposButton.tsx +0 -48
- package/src/ui/SeatSection/SeatSection.tsx +0 -187
- package/src/ui/TopAmenities/TopAmenities.tsx +0 -82
- package/src/ui/mobileweb/BottomAmenitiesMobile.tsx +0 -168
- package/src/ui/mobileweb/DateTimeSectionMobile.tsx +0 -192
- package/src/ui/mobileweb/SeatSectionMobile.tsx +0 -256
- package/src/ui/mobileweb/TopAmenitieMobile.tsx +0 -82
|
@@ -3,10 +3,6 @@ import LottiePlayer from "../../assets/LottiePlayer";
|
|
|
3
3
|
import DateService from "../../utils/DateService";
|
|
4
4
|
import { MobileServiceItemProps } from "./mobileTypes";
|
|
5
5
|
import commonService from "../../utils/CommonService";
|
|
6
|
-
import TopAmenitieMobile from "../../ui/mobileweb/TopAmenitieMobile";
|
|
7
|
-
import BottomAmenitiesMobile from "../../ui/mobileweb/BottomAmenitiesMobile";
|
|
8
|
-
import SeatSectionMobile from "../../ui/mobileweb/SeatSectionMobile";
|
|
9
|
-
import DateTimeSectionMobile from "../../ui/mobileweb/DateTimeSectionMobile";
|
|
10
6
|
|
|
11
7
|
const SEAT_EXCEPTIONS = ["Asiento mascota"];
|
|
12
8
|
|
|
@@ -43,7 +39,6 @@ function ServiceItemMobile({
|
|
|
43
39
|
}: MobileServiceItemProps): React.ReactElement {
|
|
44
40
|
const isPetSeat = (Object.keys(serviceItem?.pet_seat_info) || []).length > 0;
|
|
45
41
|
let isSoldOut = serviceItem.available_seats <= 0;
|
|
46
|
-
const showPromo = Math.random() > 0.5;
|
|
47
42
|
|
|
48
43
|
const labelId =
|
|
49
44
|
typeof serviceItem.boarding_stages === "string"
|
|
@@ -66,6 +61,194 @@ function ServiceItemMobile({
|
|
|
66
61
|
}
|
|
67
62
|
};
|
|
68
63
|
|
|
64
|
+
const seatTypes = () => {
|
|
65
|
+
let seatTypes = serviceItem.seat_types
|
|
66
|
+
?.filter((item) => getFilteredSeats(item.label))
|
|
67
|
+
?.sort((a, b) => a.fare - b.fare) // Add this line to sort by fare
|
|
68
|
+
?.slice(0, 2)
|
|
69
|
+
?.map((type, i) =>
|
|
70
|
+
exceptions.includes(type.label) ? null : (
|
|
71
|
+
<div
|
|
72
|
+
className={
|
|
73
|
+
serviceItem.seat_types?.length > 2
|
|
74
|
+
? "w-[100%] flex flex-row justify-between "
|
|
75
|
+
: "w-[100%] flex flex-row justify-between items-center"
|
|
76
|
+
}
|
|
77
|
+
key={i}
|
|
78
|
+
>
|
|
79
|
+
<span
|
|
80
|
+
className="min-[420]:text-[13px] text-[12px] "
|
|
81
|
+
style={{
|
|
82
|
+
// marginLeft: "10px",
|
|
83
|
+
color: isSoldOut ? "#bbb" : "#464647",
|
|
84
|
+
}}
|
|
85
|
+
>
|
|
86
|
+
{type.label}
|
|
87
|
+
</span>
|
|
88
|
+
<span
|
|
89
|
+
className={"min-[420]:text-[13px] text-[12px] bold-text"}
|
|
90
|
+
style={{ color: isSoldOut ? "#bbb" : colors.seatPriceColor }}
|
|
91
|
+
>
|
|
92
|
+
{commonService.currency(type.fare, currencySign)}
|
|
93
|
+
</span>
|
|
94
|
+
</div>
|
|
95
|
+
),
|
|
96
|
+
);
|
|
97
|
+
return seatTypes;
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
const seatTypesWithRemoveDuplicateSeats = () => {
|
|
101
|
+
const seatMap = new Map();
|
|
102
|
+
|
|
103
|
+
serviceItem.seat_types
|
|
104
|
+
?.filter((item) => getFilteredSeats(item.label))
|
|
105
|
+
?.forEach((item) => {
|
|
106
|
+
if (exceptions.includes(item.key as any)) return;
|
|
107
|
+
const existing = seatMap.get(item.label);
|
|
108
|
+
if (
|
|
109
|
+
!existing ||
|
|
110
|
+
parseFloat(item.fare as any) < parseFloat(existing.fare)
|
|
111
|
+
) {
|
|
112
|
+
seatMap.set(item.label, item);
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
const uniqueSeats = Array.from(seatMap.values())
|
|
117
|
+
.sort((a, b) => a.fare - b.fare)
|
|
118
|
+
.slice(0, 3);
|
|
119
|
+
return uniqueSeats.map((type, i) => {
|
|
120
|
+
return exceptions.includes(type.label) ? null : (
|
|
121
|
+
<div
|
|
122
|
+
className={
|
|
123
|
+
serviceItem.seat_types?.length > 2
|
|
124
|
+
? "w-[100%] flex flex-row justify-between "
|
|
125
|
+
: "w-[100%] flex flex-row justify-between items-center"
|
|
126
|
+
}
|
|
127
|
+
key={i}
|
|
128
|
+
>
|
|
129
|
+
<span
|
|
130
|
+
className="min-[420]:text-[13px] text-[11px] "
|
|
131
|
+
style={{
|
|
132
|
+
// marginLeft: "10px",
|
|
133
|
+
color: isSoldOut ? "#bbb" : "#464647",
|
|
134
|
+
}}
|
|
135
|
+
>
|
|
136
|
+
{commonService.truncateSeatLabel(type.label)}
|
|
137
|
+
</span>
|
|
138
|
+
<span
|
|
139
|
+
className={"min-[420]:text-[13px] text-[11px] bold-text"}
|
|
140
|
+
style={{ color: isSoldOut ? "#bbb" : colors.seatPriceColor }}
|
|
141
|
+
>
|
|
142
|
+
{/* {serviceItem?.operator_service_name === "Pullman San Andrés" &&
|
|
143
|
+
serviceItem?.available_seats <= 0
|
|
144
|
+
? null
|
|
145
|
+
: commonService.currency(type.fare, currencySign)} */}
|
|
146
|
+
|
|
147
|
+
{serviceItem?.available_seats <= 0 && !isPeru
|
|
148
|
+
? commonService.currency(0, currencySign)
|
|
149
|
+
: commonService.currency(type.fare, currencySign)}
|
|
150
|
+
</span>
|
|
151
|
+
</div>
|
|
152
|
+
);
|
|
153
|
+
});
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
const getFilteredSeats = (item) => {
|
|
157
|
+
return item;
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
const getAmenitiesImage = (name: string): string => {
|
|
161
|
+
switch (name) {
|
|
162
|
+
case "air_condtion.png": {
|
|
163
|
+
return serviceItem?.icons?.airConditionIcon;
|
|
164
|
+
}
|
|
165
|
+
case "baggage.png": {
|
|
166
|
+
return serviceItem?.icons?.baggageIcon;
|
|
167
|
+
}
|
|
168
|
+
case "charging_plug.png": {
|
|
169
|
+
return serviceItem?.icons?.chargingIcon;
|
|
170
|
+
}
|
|
171
|
+
case "coffee.png": {
|
|
172
|
+
return serviceItem?.icons?.coffeeIcon;
|
|
173
|
+
}
|
|
174
|
+
case "food_new_icon.png": {
|
|
175
|
+
return serviceItem?.icons?.foodIcon;
|
|
176
|
+
}
|
|
177
|
+
case "gaming.png": {
|
|
178
|
+
return serviceItem?.icons?.gamingIcon;
|
|
179
|
+
}
|
|
180
|
+
case "handicap.png": {
|
|
181
|
+
return serviceItem?.icons?.handicapIcon;
|
|
182
|
+
}
|
|
183
|
+
case "mobile_ticket.png": {
|
|
184
|
+
return serviceItem?.icons?.mobileTicketIcon;
|
|
185
|
+
}
|
|
186
|
+
case "movie.png": {
|
|
187
|
+
return serviceItem?.icons?.movieIcon;
|
|
188
|
+
}
|
|
189
|
+
case "restrooms.png": {
|
|
190
|
+
return serviceItem?.icons?.restroomsIcon;
|
|
191
|
+
}
|
|
192
|
+
case "snacks_new.png": {
|
|
193
|
+
return serviceItem?.icons?.snackIcon;
|
|
194
|
+
}
|
|
195
|
+
case "wifi.png": {
|
|
196
|
+
return serviceItem?.icons?.wifiIcon;
|
|
197
|
+
}
|
|
198
|
+
case "cortina_divisoria.png": {
|
|
199
|
+
return serviceItem?.icons?.cortinaIcon;
|
|
200
|
+
}
|
|
201
|
+
case "frazada.png": {
|
|
202
|
+
return serviceItem?.icons?.frazaIcon;
|
|
203
|
+
}
|
|
204
|
+
case "blanket.png": {
|
|
205
|
+
return serviceItem?.icons?.blankketIcon;
|
|
206
|
+
}
|
|
207
|
+
case "cctv.png": {
|
|
208
|
+
return serviceItem?.icons?.cctvIcon;
|
|
209
|
+
}
|
|
210
|
+
case "cup_holder.png": {
|
|
211
|
+
return serviceItem?.icons?.cupHolderIcon;
|
|
212
|
+
}
|
|
213
|
+
case "emergency_contact.png": {
|
|
214
|
+
return serviceItem?.icons?.emergencyContactIcon;
|
|
215
|
+
}
|
|
216
|
+
case "emergency_exit.png": {
|
|
217
|
+
return serviceItem?.icons?.emergencyExitIcon;
|
|
218
|
+
}
|
|
219
|
+
case "fire_extinguisher.png": {
|
|
220
|
+
return serviceItem?.icons?.fireExtinguisherIcon;
|
|
221
|
+
}
|
|
222
|
+
case "reading_light.png": {
|
|
223
|
+
return serviceItem?.icons?.readingLIghtIcon;
|
|
224
|
+
}
|
|
225
|
+
case "seat_belt.png": {
|
|
226
|
+
return serviceItem?.icons?.sercurityBeltIcon;
|
|
227
|
+
}
|
|
228
|
+
case "service_on_board.png": {
|
|
229
|
+
return serviceItem?.icons?.serviceOnBoardIcon;
|
|
230
|
+
}
|
|
231
|
+
case "personal_tv.png": {
|
|
232
|
+
return serviceItem?.icons?.personalTVIcon;
|
|
233
|
+
}
|
|
234
|
+
case "pet_admission.png": {
|
|
235
|
+
return serviceItem?.icons?.petAdmissionIcon;
|
|
236
|
+
}
|
|
237
|
+
case "music.png": {
|
|
238
|
+
return serviceItem?.icons?.musicIcon;
|
|
239
|
+
}
|
|
240
|
+
case "headset.png": {
|
|
241
|
+
return serviceItem?.icons?.headPhoneIcon;
|
|
242
|
+
}
|
|
243
|
+
case "allows_cancellation.png": {
|
|
244
|
+
return serviceItem?.icons?.allowCancellationIcon;
|
|
245
|
+
}
|
|
246
|
+
default: {
|
|
247
|
+
return "";
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
};
|
|
251
|
+
|
|
69
252
|
const amenities = () => {
|
|
70
253
|
const raw = serviceItem?.operator_details?.[3];
|
|
71
254
|
const list = Array.isArray(raw)
|
|
@@ -78,8 +261,8 @@ function ServiceItemMobile({
|
|
|
78
261
|
<img
|
|
79
262
|
key={i}
|
|
80
263
|
className="amenity"
|
|
81
|
-
height={
|
|
82
|
-
width={
|
|
264
|
+
height={14}
|
|
265
|
+
width={14}
|
|
83
266
|
// src={getAmenitiesImage(amenitiesData?.[am]?.toLowerCase())}
|
|
84
267
|
src={commonService.getAmenitiesImage(
|
|
85
268
|
amenitiesData?.[am]?.toLowerCase(),
|
|
@@ -115,6 +298,32 @@ function ServiceItemMobile({
|
|
|
115
298
|
isConexion = true;
|
|
116
299
|
}
|
|
117
300
|
|
|
301
|
+
const depTime = serviceItem.dep_time || "";
|
|
302
|
+
|
|
303
|
+
// Extract hours and minutes and check for AM/PM
|
|
304
|
+
const hasAM = depTime.includes("AM");
|
|
305
|
+
const hasPM = depTime.includes("PM");
|
|
306
|
+
const [timePart] = depTime.split(/AM|PM/).map((part) => part.trim());
|
|
307
|
+
const [hour, minute] = timePart.split(":").map(Number);
|
|
308
|
+
|
|
309
|
+
// Convert to 24-hour format
|
|
310
|
+
let cleanedDepTime;
|
|
311
|
+
if (hasAM) {
|
|
312
|
+
cleanedDepTime =
|
|
313
|
+
hour === 12
|
|
314
|
+
? `00:${minute < 10 ? "0" + minute : minute}`
|
|
315
|
+
: `${hour < 10 ? "0" + hour : hour}:${
|
|
316
|
+
minute < 10 ? "0" + minute : minute
|
|
317
|
+
}`;
|
|
318
|
+
} else if (hasPM) {
|
|
319
|
+
cleanedDepTime =
|
|
320
|
+
hour === 12
|
|
321
|
+
? `${hour}:${minute < 10 ? "0" + minute : minute}`
|
|
322
|
+
: `${hour + 12}:${minute < 10 ? "0" + minute : minute}`;
|
|
323
|
+
} else {
|
|
324
|
+
cleanedDepTime = timePart;
|
|
325
|
+
}
|
|
326
|
+
|
|
118
327
|
return (
|
|
119
328
|
<div
|
|
120
329
|
className={`relative ${
|
|
@@ -124,42 +333,28 @@ function ServiceItemMobile({
|
|
|
124
333
|
isConexion ||
|
|
125
334
|
serviceItem?.train_type_label === "Tren Express (Nuevo)" ||
|
|
126
335
|
showTopLabel
|
|
127
|
-
? "mt-[
|
|
336
|
+
? "mt-[20px]"
|
|
128
337
|
: "mt-[10px]"
|
|
129
338
|
} `}
|
|
130
339
|
style={{ backgroundColor: "#fff", zIndex: 1 }}
|
|
131
340
|
>
|
|
132
|
-
<TopAmenitieMobile
|
|
133
|
-
showTopLabel={showTopLabel}
|
|
134
|
-
isSoldOut={isSoldOut}
|
|
135
|
-
seatPriceColor={colors.seatPriceColor}
|
|
136
|
-
bombAnim={serviceItem.icons.bombAnim}
|
|
137
|
-
priorityStageAnim={serviceItem.icons.priorityStageAnim}
|
|
138
|
-
/>
|
|
139
341
|
<div
|
|
140
|
-
className={" rounded-[20px]"}
|
|
141
|
-
style={{
|
|
142
|
-
backgroundColor: "#fff",
|
|
143
|
-
zIndex: 1,
|
|
144
|
-
// borderRadius: showTopLabel ? "10px 0 10px 10px" : "10px",
|
|
145
|
-
borderRadius: "14px 0 14px 14px",
|
|
146
|
-
border: `1px solid ${colors.bottomStripColor}`,
|
|
147
|
-
}}
|
|
342
|
+
className={"border border-[#E6E6E6] rounded-[20px]"}
|
|
343
|
+
style={{ backgroundColor: "#fff", zIndex: 1 }}
|
|
148
344
|
>
|
|
149
345
|
<div
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
style={{ padding: "12px 12px 8px 12px" }}
|
|
346
|
+
className={`p-[12px] ${
|
|
347
|
+
serviceItem?.train_type_label === "Tren Express (Nuevo)" ||
|
|
348
|
+
showTopLabel ||
|
|
349
|
+
serviceItem?.is_direct_trip ||
|
|
350
|
+
serviceItem?.is_transpordo
|
|
351
|
+
? "mt-[10px]"
|
|
352
|
+
: ""
|
|
353
|
+
}`}
|
|
159
354
|
>
|
|
160
355
|
{/* Header with operator info and favorite */}
|
|
161
|
-
<div className="flex justify-between
|
|
162
|
-
<div className="flex items-center
|
|
356
|
+
<div className="flex justify-between mb-[8px]">
|
|
357
|
+
<div className="flex items-center w-[50%] justify-between">
|
|
163
358
|
<div className="w-[120px] overflow-y-hidden">
|
|
164
359
|
<img
|
|
165
360
|
src={serviceItem.operator_details[0]}
|
|
@@ -174,44 +369,21 @@ function ServiceItemMobile({
|
|
|
174
369
|
{serviceItem?.operator_details[2]}
|
|
175
370
|
</div>
|
|
176
371
|
) : showRating ? (
|
|
177
|
-
<div className="flex min-[420]:text-[13px] text-[12px]
|
|
178
|
-
<
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
{getServiceStars(serviceItem)}
|
|
189
|
-
</span>
|
|
190
|
-
</div>
|
|
191
|
-
|
|
192
|
-
<div
|
|
193
|
-
className="flex items-center cursor-pointer "
|
|
194
|
-
style={{ color: isSoldOut ? "#bbb" : "text-[#464647]" }}
|
|
195
|
-
>
|
|
196
|
-
<span className="ml-[3px] min-[420]:text-[13px] text-[12px]">
|
|
197
|
-
{serviceItem.operator_details[2]}
|
|
198
|
-
</span>
|
|
199
|
-
</div>
|
|
200
|
-
</div>
|
|
372
|
+
<div className="flex min-[420]:text-[13px] text-[12px] bold-text items-center">
|
|
373
|
+
<img
|
|
374
|
+
src={serviceItem.icons.rating}
|
|
375
|
+
alt="origin"
|
|
376
|
+
className={`w-[12px] h-[12px] mr-[4px] object-contain ${
|
|
377
|
+
isSoldOut ? "grayscale" : ""
|
|
378
|
+
}`}
|
|
379
|
+
/>
|
|
380
|
+
<span style={{ lineHeight: "normal" }}>
|
|
381
|
+
{getServiceStars(serviceItem)}
|
|
382
|
+
</span>
|
|
201
383
|
</div>
|
|
202
384
|
) : null}
|
|
203
385
|
</div>
|
|
204
386
|
{showLastSeats ? (
|
|
205
|
-
<div className="flex justify-end ">
|
|
206
|
-
{serviceItem?.available_seats < 10 &&
|
|
207
|
-
serviceItem?.available_seats > 0 && (
|
|
208
|
-
<div className="text-[10px] text-[#464647] text-center">
|
|
209
|
-
¡ Últimos Asientos!
|
|
210
|
-
</div>
|
|
211
|
-
)}
|
|
212
|
-
</div>
|
|
213
|
-
) : null}
|
|
214
|
-
{/* {showLastSeats ? (
|
|
215
387
|
<div className="flex justify-end -mt-[5px] -mb-[5px] items-center pt-[5px] pb-[5px] text-center ">
|
|
216
388
|
{serviceItem?.available_seats < 10 &&
|
|
217
389
|
serviceItem?.available_seats > 0 && (
|
|
@@ -226,58 +398,267 @@ function ServiceItemMobile({
|
|
|
226
398
|
</span>
|
|
227
399
|
)}
|
|
228
400
|
</div>
|
|
229
|
-
) : null}
|
|
401
|
+
) : null}
|
|
230
402
|
</div>
|
|
231
403
|
|
|
232
|
-
<
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
404
|
+
<div
|
|
405
|
+
className="flex justify-between gap-[5px] w-full"
|
|
406
|
+
onClick={onBookButtonPress}
|
|
407
|
+
>
|
|
408
|
+
{/* DATE AND TIME */}
|
|
409
|
+
<div
|
|
410
|
+
className="min-h-[2.5rem] flex flex-col justify-between gap-[4px] w-[50%] "
|
|
411
|
+
style={{ justifyContent: isCiva && "center" }}
|
|
412
|
+
>
|
|
413
|
+
<div
|
|
414
|
+
className={`flex items-center min-[420]:text-[13px] text-[12px] justify-between ${
|
|
415
|
+
isSoldOut ? "text-[#c0c0c0]" : ""
|
|
416
|
+
}`}
|
|
417
|
+
>
|
|
418
|
+
<div className="flex items-center" style={{ flex: 1 }}>
|
|
419
|
+
<div>
|
|
420
|
+
{" "}
|
|
421
|
+
{orignLabel ? (
|
|
422
|
+
<div className="w-[60px]">{orignLabel}</div>
|
|
423
|
+
) : (
|
|
424
|
+
<div className="w-[14px] h-auto mr-[5px]">
|
|
425
|
+
<img
|
|
426
|
+
src={serviceItem.icons?.origin}
|
|
427
|
+
alt="origin"
|
|
428
|
+
className={`w-[14px] h-auto mr-[5px] ${
|
|
429
|
+
isSoldOut ? "grayscale" : ""
|
|
430
|
+
}`}
|
|
431
|
+
/>
|
|
432
|
+
</div>
|
|
433
|
+
)}
|
|
434
|
+
</div>
|
|
435
|
+
<div
|
|
436
|
+
className="flex items-center relative capitalize justify-between "
|
|
437
|
+
style={{ flex: 1 }}
|
|
438
|
+
>
|
|
439
|
+
<span className="cursor-pointer black-text">
|
|
440
|
+
{DateService.getServiceItemDate(serviceItem.travel_date)}
|
|
441
|
+
</span>
|
|
442
|
+
<div className="absolute left-[50%]">•</div>
|
|
443
|
+
<div className="font-[900] relative black-text">
|
|
444
|
+
{isLinatal ? (
|
|
445
|
+
<div>
|
|
446
|
+
<span>
|
|
447
|
+
{" "}
|
|
448
|
+
{cleanedDepTime}{" "}
|
|
449
|
+
<span>{hasPM ? "PM" : hasAM ? "AM" : ""}</span>
|
|
450
|
+
</span>
|
|
451
|
+
<span>
|
|
452
|
+
{serviceItem?.dep_time.includes("AM") ||
|
|
453
|
+
serviceItem?.dep_time.includes("PM")
|
|
454
|
+
? null
|
|
455
|
+
: DateService.ampmOnly(serviceItem.dep_time)}
|
|
456
|
+
</span>
|
|
457
|
+
</div>
|
|
458
|
+
) : (
|
|
459
|
+
DateService.formatTime(serviceItem.dep_time)
|
|
460
|
+
)}
|
|
461
|
+
</div>
|
|
462
|
+
</div>
|
|
463
|
+
</div>
|
|
464
|
+
</div>
|
|
465
|
+
{isCiva ? null : (
|
|
466
|
+
<div
|
|
467
|
+
className={`flex items-center min-[420]:text-[13px] text-[12px] justify-between ${
|
|
468
|
+
isSoldOut ? "text-[#c0c0c0]" : ""
|
|
469
|
+
}`}
|
|
470
|
+
>
|
|
471
|
+
<div className="flex items-center" style={{ flex: 1 }}>
|
|
472
|
+
<div>
|
|
473
|
+
{" "}
|
|
474
|
+
{destinationLabel ? (
|
|
475
|
+
<div className="w-[60px]">{destinationLabel}</div>
|
|
476
|
+
) : (
|
|
477
|
+
<div className="w-[14px] h-auto mr-[5px]">
|
|
478
|
+
<img
|
|
479
|
+
src={serviceItem.icons?.destination}
|
|
480
|
+
alt="destination"
|
|
481
|
+
className={`w-[14px] h-auto mr-[5px] ${
|
|
482
|
+
isSoldOut ? "grayscale" : ""
|
|
483
|
+
}`}
|
|
484
|
+
/>
|
|
485
|
+
</div>
|
|
486
|
+
)}
|
|
487
|
+
</div>
|
|
488
|
+
<div
|
|
489
|
+
className="flex items-center relative capitalize justify-between "
|
|
490
|
+
style={{ flex: 1 }}
|
|
491
|
+
>
|
|
492
|
+
<span className="cursor-pointer black-text">
|
|
493
|
+
{DateService.getServiceItemDate(
|
|
494
|
+
serviceItem.arrival_date,
|
|
495
|
+
)}
|
|
496
|
+
</span>
|
|
497
|
+
<div className="absolute left-[50%]">•</div>
|
|
498
|
+
<div className="font-[900] relative black-text">
|
|
499
|
+
{DateService.formatTime(serviceItem.arr_time)}
|
|
500
|
+
</div>
|
|
501
|
+
</div>
|
|
502
|
+
</div>
|
|
503
|
+
</div>
|
|
504
|
+
)}
|
|
505
|
+
</div>
|
|
506
|
+
<div
|
|
507
|
+
style={{
|
|
508
|
+
width: "1px",
|
|
509
|
+
height: "2.5rem",
|
|
510
|
+
backgroundColor: "#ccc",
|
|
511
|
+
margin: "auto",
|
|
512
|
+
}}
|
|
513
|
+
></div>
|
|
514
|
+
{/* SEATS */}
|
|
515
|
+
<div
|
|
516
|
+
className="content-center"
|
|
517
|
+
style={{
|
|
518
|
+
width: isPeru ? "40%" : "40%",
|
|
519
|
+
}}
|
|
520
|
+
>
|
|
521
|
+
<div
|
|
522
|
+
className="flex flex-col justify-between h-[2.5rem] "
|
|
523
|
+
style={{
|
|
524
|
+
gap: isSoldOut ? "0px" : "5px",
|
|
525
|
+
justifyContent:
|
|
526
|
+
serviceItem.seat_types?.length > 2
|
|
527
|
+
? "space-between"
|
|
528
|
+
: "center",
|
|
529
|
+
}}
|
|
530
|
+
>
|
|
531
|
+
{removeDuplicateSeats
|
|
532
|
+
? seatTypesWithRemoveDuplicateSeats()
|
|
533
|
+
: seatTypes()}
|
|
534
|
+
|
|
535
|
+
{isSoldOut ? (
|
|
536
|
+
<div className="flex justify-end">
|
|
537
|
+
<span
|
|
538
|
+
className={
|
|
539
|
+
"min-[420]:text-[13px] text-[12px] text-[#ccc]"
|
|
540
|
+
}
|
|
541
|
+
>
|
|
542
|
+
Agotado
|
|
543
|
+
</span>
|
|
544
|
+
</div>
|
|
545
|
+
) : null}
|
|
546
|
+
</div>
|
|
547
|
+
</div>
|
|
548
|
+
</div>
|
|
549
|
+
<div className="bg-[#E6E6E6] -ml-[12px] -mr-[12px] mt-[10px] mb-[10px] h-[1px]"></div>
|
|
550
|
+
<div
|
|
551
|
+
className={`${"flex justify-between items-center items-center "}`}
|
|
552
|
+
>
|
|
553
|
+
{/* Rating */}
|
|
554
|
+
<div>
|
|
555
|
+
<div className="flex items-center ">
|
|
556
|
+
<div
|
|
557
|
+
className="flex items-center cursor-pointer "
|
|
558
|
+
style={{ color: isSoldOut ? "#bbb" : "text-[#464647]" }}
|
|
559
|
+
>
|
|
560
|
+
<span className="ml-[3px] min-[420]:text-[13px] text-[12px] bold-text">
|
|
561
|
+
{serviceItem.operator_details[2]}
|
|
562
|
+
</span>
|
|
563
|
+
</div>
|
|
564
|
+
</div>
|
|
565
|
+
</div>
|
|
566
|
+
|
|
567
|
+
<div
|
|
568
|
+
className="flex relative "
|
|
569
|
+
style={{ color: isSoldOut ? "#bbb" : "text-[#464647]" }}
|
|
570
|
+
>
|
|
571
|
+
<div
|
|
572
|
+
className={`w-[12px] h-auto mr-[2px] ${
|
|
573
|
+
isSoldOut ? "grayscale" : ""
|
|
574
|
+
}`}
|
|
575
|
+
>
|
|
576
|
+
{renderIcon("hours", "14px")}
|
|
577
|
+
</div>
|
|
578
|
+
|
|
579
|
+
<div
|
|
580
|
+
className={`cursor-default group min-[420]:text-[13px] text-[12px] ${
|
|
581
|
+
isSoldOut ? "text-[#c0c0c0]" : ""
|
|
582
|
+
}`}
|
|
583
|
+
style={{ lineHeight: "normal" }}
|
|
584
|
+
>
|
|
585
|
+
{serviceItem.duration}hrs
|
|
586
|
+
</div>
|
|
587
|
+
</div>
|
|
588
|
+
|
|
589
|
+
<div style={{ opacity: isSoldOut ? 0.5 : 1 }}>{amenities()}</div>
|
|
590
|
+
|
|
591
|
+
{(serviceItem.is_change_ticket || isPetSeat) && (
|
|
592
|
+
<div
|
|
593
|
+
onClick={() => {
|
|
594
|
+
setShowDropdown(!showDropdown);
|
|
595
|
+
setAmenetiesAtomValue({
|
|
596
|
+
service: serviceItem,
|
|
597
|
+
showTopLabel: showTopLabel,
|
|
598
|
+
});
|
|
599
|
+
}}
|
|
600
|
+
className="flex items-center"
|
|
601
|
+
>
|
|
602
|
+
{serviceItem.pet_seat_info &&
|
|
603
|
+
Object.keys(serviceItem.pet_seat_info).length > 0 ? (
|
|
604
|
+
<div className="flex items-center">
|
|
605
|
+
<div className={`relative group cursor-default `}>
|
|
606
|
+
<div className="flex items-center">
|
|
607
|
+
<div
|
|
608
|
+
className={`mr-[5px] ${isSoldOut ? "grayscale" : ""}`}
|
|
609
|
+
>
|
|
610
|
+
<LottiePlayer
|
|
611
|
+
animationData={serviceItem.icons.petFriendlyAnim}
|
|
612
|
+
width="20px"
|
|
613
|
+
height="20px"
|
|
614
|
+
/>
|
|
615
|
+
</div>
|
|
616
|
+
</div>
|
|
617
|
+
</div>
|
|
618
|
+
</div>
|
|
619
|
+
) : null}
|
|
620
|
+
|
|
621
|
+
{/* Flexible ticket */}
|
|
622
|
+
{serviceItem.is_change_ticket && (
|
|
623
|
+
<div className="flex items-center">
|
|
624
|
+
<div className="relative group cursor-default">
|
|
625
|
+
<div className="flex items-center">
|
|
626
|
+
<div
|
|
627
|
+
className={`mr-[5px] ${isSoldOut ? "grayscale" : ""}`}
|
|
628
|
+
>
|
|
629
|
+
<LottiePlayer
|
|
630
|
+
animationData={serviceItem.icons.flexibleAnim}
|
|
631
|
+
width="20px"
|
|
632
|
+
height="20px"
|
|
633
|
+
/>
|
|
634
|
+
</div>
|
|
635
|
+
</div>
|
|
636
|
+
</div>
|
|
637
|
+
</div>
|
|
638
|
+
)}
|
|
639
|
+
|
|
640
|
+
{serviceItem?.is_tracking_enabled && (
|
|
641
|
+
<div className="flex items-center mr-[10px]">
|
|
642
|
+
<div
|
|
643
|
+
className={`h-auto mr-[4px] min-[420]:text-[13px] text-[11px] text-[#464647] ${
|
|
644
|
+
isSoldOut ? "grayscale" : ""
|
|
645
|
+
}`}
|
|
646
|
+
>
|
|
647
|
+
<LottiePlayer
|
|
648
|
+
animationData={serviceItem.icons.locationAnim}
|
|
649
|
+
width="20px"
|
|
650
|
+
height="20px"
|
|
651
|
+
/>
|
|
652
|
+
</div>
|
|
653
|
+
</div>
|
|
654
|
+
)}
|
|
655
|
+
|
|
656
|
+
{(serviceItem.is_change_ticket || isPetSeat) && (
|
|
657
|
+
<img src={serviceItem.icons.plus} alt="icon" width={11} />
|
|
658
|
+
)}
|
|
659
|
+
</div>
|
|
660
|
+
)}
|
|
661
|
+
</div>
|
|
281
662
|
</div>
|
|
282
663
|
|
|
283
664
|
{serviceItem?.offer_text && (
|
|
@@ -303,7 +684,7 @@ function ServiceItemMobile({
|
|
|
303
684
|
)}
|
|
304
685
|
|
|
305
686
|
<div className="absolute -top-[14px] left-0 w-full flex items-center justify-end gap-[12px] pr-[20px] z-10 ">
|
|
306
|
-
{
|
|
687
|
+
{showTopLabel && (
|
|
307
688
|
<div
|
|
308
689
|
className={`flex items-center gap-[2px] py-[5px] px-[10px] rounded-[38px] min-[420]:text-[12px] text-[10px] z-20 `}
|
|
309
690
|
style={{
|
|
@@ -371,7 +752,7 @@ function ServiceItemMobile({
|
|
|
371
752
|
/>
|
|
372
753
|
<div>{"Tren Express"}</div>
|
|
373
754
|
</div>
|
|
374
|
-
)}
|
|
755
|
+
)}
|
|
375
756
|
</div>
|
|
376
757
|
</div>
|
|
377
758
|
</div>
|