kupos-ui-components-lib 9.9.1 → 9.9.2
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/dist/KuposUIComponent.d.ts +3 -0
- package/dist/components/ServiceItem/PeruServiceItemDesktop.d.ts +1 -1
- package/dist/components/ServiceItem/PeruServiceItemDesktop.js +2 -2
- package/dist/components/ServiceItem/ServiceItemDesktop.d.ts +1 -1
- package/dist/components/ServiceItem/ServiceItemDesktop.js +30 -31
- package/dist/components/ServiceItem/ServiceItemMobile.d.ts +1 -1
- package/dist/components/ServiceItem/ServiceItemMobile.js +43 -17
- package/dist/components/ServiceItem/mobileTypes.d.ts +48 -1
- package/dist/components/ServiceItem/types.d.ts +27 -9
- package/dist/styles.css +215 -6
- package/dist/ui/ExpendedDropDown/ExpandedDropdown.d.ts +1 -2
- package/dist/ui/ExpendedDropDown/ExpandedDropdown.js +2 -4
- package/dist/ui/FeaturServiceUiMobile/FeatureServiceUiMobile.js +22 -41
- package/dist/ui/FeatureServiceUI/FeatureServiceUi.js +24 -44
- package/dist/ui/OfferBanner.d.ts +2 -0
- package/dist/ui/OfferBanner.js +19 -14
- package/dist/ui/SeatSection/SeatSection.d.ts +1 -7
- package/dist/ui/SeatSection/SeatSection.js +12 -44
- package/dist/utils/CommonService.d.ts +3 -0
- package/dist/utils/CommonService.js +18 -1
- package/package.json +1 -1
- package/src/KuposUIComponent.tsx +3 -0
- package/src/assets/images/anims/service_list/flame_anim.json +1 -0
- package/src/assets/images/anims/service_list/thunder_icon.json +1 -0
- package/src/assets/images/anims/service_list/users_anim.json +1 -0
- package/src/components/ServiceItem/PeruServiceItemDesktop.tsx +35 -24
- package/src/components/ServiceItem/ServiceItemDesktop.tsx +65 -53
- package/src/components/ServiceItem/ServiceItemMobile.tsx +387 -288
- package/src/components/ServiceItem/mobileTypes.ts +50 -7
- package/src/components/ServiceItem/types.ts +39 -25
- package/src/styles.css +15 -0
- package/src/ui/ExpendedDropDown/ExpandedDropdown.tsx +2 -4
- package/src/ui/FeaturServiceUiMobile/FeatureServiceUiMobile.tsx +575 -0
- package/src/ui/FeatureServiceUI/FeatureServiceUi.tsx +610 -0
- package/src/ui/OfferBanner.tsx +31 -10
- package/src/ui/SeatSection/SeatSection.tsx +21 -88
- package/src/utils/CommonService.ts +26 -1
|
@@ -0,0 +1,610 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import LottiePlayer from "../../assets/LottiePlayer";
|
|
3
|
+
import commonService from "../../utils/CommonService";
|
|
4
|
+
|
|
5
|
+
const TIME_SLOTS = [
|
|
6
|
+
"Entre 07:00 AM y 10:00 AM",
|
|
7
|
+
"Entre 11:00 AM y 14:00 AM",
|
|
8
|
+
"Entre 15:00 PM y 18:00 PM",
|
|
9
|
+
"Entre 19:00 PM y 22:00 PM",
|
|
10
|
+
];
|
|
11
|
+
|
|
12
|
+
const HARDCODED_OPERATORS = [
|
|
13
|
+
{
|
|
14
|
+
logo: "https://upload.wikimedia.org/wikipedia/commons/thumb/4/4e/Turbus_logo.svg/320px-Turbus_logo.svg.png",
|
|
15
|
+
name: "Turbus",
|
|
16
|
+
time: "7:00 am",
|
|
17
|
+
seatsAvailable: "3 disponibles",
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
logo: "https://upload.wikimedia.org/wikipedia/commons/thumb/6/6e/Pullman_Bus_logo.svg/320px-Pullman_Bus_logo.svg.png",
|
|
21
|
+
name: "Turbus",
|
|
22
|
+
time: "8:00 am",
|
|
23
|
+
seatsAvailable: "5 disponibles",
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
logo: "https://upload.wikimedia.org/wikipedia/commons/thumb/4/4e/Turbus_logo.svg/320px-Turbus_logo.svg.png",
|
|
27
|
+
name: "Turbus",
|
|
28
|
+
time: "9:00 am",
|
|
29
|
+
seatsAvailable: "3 disponibles",
|
|
30
|
+
},
|
|
31
|
+
];
|
|
32
|
+
|
|
33
|
+
const FeatureServiceUi = ({
|
|
34
|
+
serviceItem,
|
|
35
|
+
showTopLabel,
|
|
36
|
+
isSoldOut,
|
|
37
|
+
getAnimationIcon,
|
|
38
|
+
cityOrigin,
|
|
39
|
+
cityDestination,
|
|
40
|
+
renderIcon,
|
|
41
|
+
viewersConfig,
|
|
42
|
+
isFeatureDropDownExpand,
|
|
43
|
+
onToggleExpand,
|
|
44
|
+
ticketQuantity = 1,
|
|
45
|
+
onIncreaseTicketQuantity,
|
|
46
|
+
onDecreaseTicketQuantity,
|
|
47
|
+
onBookButtonPress,
|
|
48
|
+
selectedTimeSlot,
|
|
49
|
+
onTimeSlotChange,
|
|
50
|
+
isTimeDropdownOpen,
|
|
51
|
+
onTimeDropdownToggle,
|
|
52
|
+
wowDealData = undefined,
|
|
53
|
+
}) => {
|
|
54
|
+
// Use wow_deal services if available, otherwise fall back to serviceItem operators or hardcoded
|
|
55
|
+
const operators =
|
|
56
|
+
wowDealData?.services?.length > 0
|
|
57
|
+
? wowDealData.services.slice(0, 3).map((service: any) => ({
|
|
58
|
+
logo: service.operator_logo_url,
|
|
59
|
+
name: service.operator_name,
|
|
60
|
+
time: service.departure_time,
|
|
61
|
+
seatsAvailable: `${service.available_seats} disponibles`,
|
|
62
|
+
}))
|
|
63
|
+
: serviceItem?.operators?.length > 0
|
|
64
|
+
? serviceItem.operators
|
|
65
|
+
: HARDCODED_OPERATORS;
|
|
66
|
+
|
|
67
|
+
// Use wow_deal pricing if available
|
|
68
|
+
const finalPrice = wowDealData?.final_price || 4000;
|
|
69
|
+
const originalPrice = wowDealData?.original_price || 10000;
|
|
70
|
+
const savingsPercent = wowDealData?.savings_percent || 60;
|
|
71
|
+
const operatorsCompetingCount = wowDealData?.operators_competing_count || 3;
|
|
72
|
+
const maxSeatsPerBooking = wowDealData?.max_seats_per_booking || 4;
|
|
73
|
+
const expiresAt = wowDealData?.expires_at;
|
|
74
|
+
const isPostPaymentAssignment = wowDealData?.is_post_payment_assignment;
|
|
75
|
+
const dealWindowFrom = wowDealData?.deal_window_from || "07:00";
|
|
76
|
+
const dealWindowTo = wowDealData?.deal_window_to || "10:00";
|
|
77
|
+
const travelDate = wowDealData?.travel_date;
|
|
78
|
+
|
|
79
|
+
// Calculate countdown seconds from expires_at ISO timestamp
|
|
80
|
+
const getCountdownSeconds = () => {
|
|
81
|
+
if (!expiresAt) return 599;
|
|
82
|
+
const expires = new Date(expiresAt).getTime();
|
|
83
|
+
const now = Date.now();
|
|
84
|
+
const seconds = Math.max(0, Math.floor((expires - now) / 1000));
|
|
85
|
+
return seconds;
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
// Generate time slot from deal window
|
|
89
|
+
const dynamicTimeSlot = `Entre ${dealWindowFrom} y ${dealWindowTo}`;
|
|
90
|
+
const displayTimeSlot = selectedTimeSlot || dynamicTimeSlot;
|
|
91
|
+
|
|
92
|
+
const isItemExpanded =
|
|
93
|
+
serviceItem.id === isFeatureDropDownExpand ||
|
|
94
|
+
isFeatureDropDownExpand === true;
|
|
95
|
+
const isThisTimeDropdownOpen = isTimeDropdownOpen === serviceItem.id;
|
|
96
|
+
const canDecreaseTicketQuantity = ticketQuantity > 1;
|
|
97
|
+
|
|
98
|
+
const departures = wowDealData?.services
|
|
99
|
+
?.map((s) => s.departure_time)
|
|
100
|
+
?.filter(Boolean);
|
|
101
|
+
|
|
102
|
+
let departureRange = `Entre ${dealWindowFrom} y ${dealWindowTo}`;
|
|
103
|
+
|
|
104
|
+
if (departures?.length) {
|
|
105
|
+
const sorted = [...departures].sort((a, b) => {
|
|
106
|
+
const [ah, am] = a.split(":").map(Number);
|
|
107
|
+
const [bh, bm] = b.split(":").map(Number);
|
|
108
|
+
return ah * 60 + am - (bh * 60 + bm);
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
departureRange = `Entre ${sorted[0]} y ${sorted[sorted.length - 1]}`;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
const HOW_IT_WORKS_STEPS = [
|
|
115
|
+
{
|
|
116
|
+
icon: "flexible",
|
|
117
|
+
name: "Salida flexible",
|
|
118
|
+
text: `Viajas en un horario entre las ${dealWindowFrom} y las ${dealWindowTo} del día elegido.`,
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
icon: "bus",
|
|
122
|
+
name: "Empresa asignada",
|
|
123
|
+
text: isPostPaymentAssignment
|
|
124
|
+
? "Empresa y hora a confirmar luego del pago."
|
|
125
|
+
: "Una de las empresas confirmará tu viaje al instante tras el pago.",
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
icon: "price",
|
|
129
|
+
name: "Precio garantizado",
|
|
130
|
+
text: "Mejor precio garantizado. Sin cambios ni cancelación.",
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
icon: "ticket",
|
|
134
|
+
name: "¡Listo!",
|
|
135
|
+
text: "Recibe todos los detalles de tu viaje al instante tras la compra.",
|
|
136
|
+
},
|
|
137
|
+
];
|
|
138
|
+
|
|
139
|
+
const FeatureStepIcon = ({ icon }) => {
|
|
140
|
+
switch (icon) {
|
|
141
|
+
case "flexible":
|
|
142
|
+
return renderIcon("flexibleIcon", "24px");
|
|
143
|
+
case "bus":
|
|
144
|
+
return renderIcon("empressaIcon", "24px");
|
|
145
|
+
case "price":
|
|
146
|
+
return renderIcon("precioIcon", "24px");
|
|
147
|
+
default:
|
|
148
|
+
return renderIcon("listoIcon", "24px");
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
return (
|
|
153
|
+
<div
|
|
154
|
+
// ${
|
|
155
|
+
// serviceItem.offer_text ? "mb-[55px]" : "mb-[10px]"
|
|
156
|
+
// }
|
|
157
|
+
className={`relative mb-[10px]
|
|
158
|
+
${serviceItem?.is_direct_trip ||
|
|
159
|
+
serviceItem?.train_type_label === "Tren Express (Nuevo)" ||
|
|
160
|
+
showTopLabel
|
|
161
|
+
? "mt-[24px]"
|
|
162
|
+
: "mt-[20px]"
|
|
163
|
+
}`}
|
|
164
|
+
>
|
|
165
|
+
<div
|
|
166
|
+
className="border border-[#ccc]"
|
|
167
|
+
style={{
|
|
168
|
+
// border: "0.6px solid #ccc",
|
|
169
|
+
padding: "14px",
|
|
170
|
+
borderRadius: "14px",
|
|
171
|
+
}}
|
|
172
|
+
>
|
|
173
|
+
<div className="flex justify-between items-center px-[14px] pb-[10px] text-[13.33px]">
|
|
174
|
+
<div className="flex items-center gap-[10px]">
|
|
175
|
+
<span>Salida flexible</span>
|
|
176
|
+
<div
|
|
177
|
+
className="bold-text font-[9px]"
|
|
178
|
+
style={{
|
|
179
|
+
backgroundColor: "#FF5C60",
|
|
180
|
+
padding: "5px 8px",
|
|
181
|
+
borderRadius: "10px",
|
|
182
|
+
color: "#fff",
|
|
183
|
+
animation: "pulse-zoom 2s ease-in-out infinite",
|
|
184
|
+
whiteSpace: "nowrap",
|
|
185
|
+
fontSize: "12px",
|
|
186
|
+
}}
|
|
187
|
+
>
|
|
188
|
+
<span>AHORRAS {savingsPercent}%</span>
|
|
189
|
+
</div>
|
|
190
|
+
</div>
|
|
191
|
+
<div className="flex items-center">
|
|
192
|
+
{/* {renderIcon("fireIcon", "14px")}{" "} */}
|
|
193
|
+
<div className="mb-[2px]">
|
|
194
|
+
<LottiePlayer
|
|
195
|
+
// animationData={serviceItem.icons.flexibleAnim}
|
|
196
|
+
animationData={getAnimationIcon("flameAnimation")}
|
|
197
|
+
width="18px"
|
|
198
|
+
height="18px"
|
|
199
|
+
/>
|
|
200
|
+
</div>
|
|
201
|
+
<span className="bold-text">Remate</span> términa en
|
|
202
|
+
<span
|
|
203
|
+
className="bold-text text-end"
|
|
204
|
+
ref={(node) => commonService.startCountdown(node, getCountdownSeconds())}
|
|
205
|
+
style={{
|
|
206
|
+
fontVariantNumeric: "tabular-nums",
|
|
207
|
+
display: "inline-block",
|
|
208
|
+
color: "#FF5C60",
|
|
209
|
+
minWidth: "40px",
|
|
210
|
+
}}
|
|
211
|
+
/>
|
|
212
|
+
</div>
|
|
213
|
+
</div>
|
|
214
|
+
<div
|
|
215
|
+
id={`service-card-${serviceItem.id}`}
|
|
216
|
+
className="bg-[#0C1421] text-white mx-auto relative rounded-[14px] p-[14px] text-[13.33px]"
|
|
217
|
+
>
|
|
218
|
+
<div className="grid grid-cols-[25%_48%_27%] items-stretch">
|
|
219
|
+
{/* LEFT: origin, destination, flexible, time, confirmed seat */}
|
|
220
|
+
<div className="flex flex-col justify-between gap-[20px] mb-[16px] pr-[22px]">
|
|
221
|
+
<div className="flex flex-col gap-[8px]">
|
|
222
|
+
<div className="flex items-center gap-[8px]">
|
|
223
|
+
<img
|
|
224
|
+
src={serviceItem.icons?.whiteOrigin}
|
|
225
|
+
alt="origin"
|
|
226
|
+
className={`w-[14px] h-[14px] shrink-0 ${isSoldOut ? "grayscale" : ""
|
|
227
|
+
}`}
|
|
228
|
+
/>
|
|
229
|
+
<span className="text-[13px] bold-text">
|
|
230
|
+
{cityOrigin?.label.split(",")[0]}
|
|
231
|
+
</span>
|
|
232
|
+
</div>
|
|
233
|
+
<div className="flex items-center gap-[8px]">
|
|
234
|
+
<img
|
|
235
|
+
src={serviceItem.icons?.whiteDestination}
|
|
236
|
+
alt="destination"
|
|
237
|
+
className={`w-[14px] h-[14px] shrink-0 ${isSoldOut ? "grayscale" : ""
|
|
238
|
+
}`}
|
|
239
|
+
style={{ opacity: isSoldOut ? 0.5 : 1 }}
|
|
240
|
+
/>
|
|
241
|
+
<span className="text-[13px] bold-text">
|
|
242
|
+
{cityDestination?.label.split(",")[0]}
|
|
243
|
+
</span>
|
|
244
|
+
</div>
|
|
245
|
+
</div>
|
|
246
|
+
|
|
247
|
+
<div className="flex flex-col gap-[8px]">
|
|
248
|
+
<div className="text-[12px] bold-text">
|
|
249
|
+
{travelDate ? new Date(travelDate).toLocaleDateString('es-CL', { weekday: 'long', day: 'numeric', month: 'long' }) : 'Viernes 23 de mayo'}
|
|
250
|
+
</div>
|
|
251
|
+
|
|
252
|
+
<div className="bold-text text-[12px] text-white">
|
|
253
|
+
{departureRange}
|
|
254
|
+
</div>
|
|
255
|
+
|
|
256
|
+
{/* <div
|
|
257
|
+
className="kupos-time-dd relative"
|
|
258
|
+
tabIndex={0}
|
|
259
|
+
onBlur={(e) => {
|
|
260
|
+
if (!e.currentTarget.contains(e.relatedTarget as Node)) {
|
|
261
|
+
onTimeDropdownToggle?.(null);
|
|
262
|
+
}
|
|
263
|
+
}}
|
|
264
|
+
style={{ outline: "none" }}
|
|
265
|
+
>
|
|
266
|
+
<button
|
|
267
|
+
type="button"
|
|
268
|
+
onClick={() =>
|
|
269
|
+
onTimeDropdownToggle?.(
|
|
270
|
+
isThisTimeDropdownOpen ? null : serviceItem.id,
|
|
271
|
+
)
|
|
272
|
+
}
|
|
273
|
+
className="flex whitespace-nowrap cursor-pointer select-none items-center gap-[6px] border-none bg-transparent p-0 bold-text text-[12px] text-[white]"
|
|
274
|
+
>
|
|
275
|
+
<span>{displayTimeSlot}</span>
|
|
276
|
+
<img
|
|
277
|
+
src={serviceItem?.icons?.downArrow}
|
|
278
|
+
alt="down arrow"
|
|
279
|
+
className={`kupos-time-chevron transition-transform duration-200 ${isThisTimeDropdownOpen ? "rotate-180" : "rotate-0"}`}
|
|
280
|
+
style={{
|
|
281
|
+
width: "12px",
|
|
282
|
+
height: "8px",
|
|
283
|
+
filter: "brightness(0) invert(1)",
|
|
284
|
+
}}
|
|
285
|
+
/>
|
|
286
|
+
</button>
|
|
287
|
+
{isThisTimeDropdownOpen && (
|
|
288
|
+
<>
|
|
289
|
+
<div
|
|
290
|
+
className="absolute left-0 top-[calc(100%+10px)]"
|
|
291
|
+
style={{
|
|
292
|
+
zIndex: 20,
|
|
293
|
+
backgroundColor: "#fff",
|
|
294
|
+
borderRadius: "14px",
|
|
295
|
+
minWidth: "190px",
|
|
296
|
+
boxShadow: "0 8px 32px rgba(0,0,0,0.28)",
|
|
297
|
+
overflow: "hidden",
|
|
298
|
+
padding: "6px 0",
|
|
299
|
+
}}
|
|
300
|
+
>
|
|
301
|
+
{TIME_SLOTS.map((slot) => {
|
|
302
|
+
const isActive = slot === selectedTimeSlot;
|
|
303
|
+
return (
|
|
304
|
+
<button
|
|
305
|
+
key={slot}
|
|
306
|
+
type="button"
|
|
307
|
+
onClick={() => {
|
|
308
|
+
onTimeSlotChange?.(slot);
|
|
309
|
+
onTimeDropdownToggle?.(null);
|
|
310
|
+
}}
|
|
311
|
+
className={`flex w-full cursor-pointer items-center gap-[10px] border-none px-[12px] py-[9px] text-left text-[13px] ${isActive ? "bg-[#FF5C60] font-bold text-[white]" : "bg-transparent font-normal text-[#1a1a1a]"}`}
|
|
312
|
+
>
|
|
313
|
+
<span>{slot}</span>
|
|
314
|
+
</button>
|
|
315
|
+
);
|
|
316
|
+
})}
|
|
317
|
+
</div>
|
|
318
|
+
</>
|
|
319
|
+
)}
|
|
320
|
+
</div> */}
|
|
321
|
+
|
|
322
|
+
</div>
|
|
323
|
+
|
|
324
|
+
<div className="flex flex-col items-start gap-[10px] text-[12px] ">
|
|
325
|
+
<div className="flex items-justify gap-[8px]">
|
|
326
|
+
{renderIcon("sheildIcon", "16px")}
|
|
327
|
+
|
|
328
|
+
<span
|
|
329
|
+
className="text-[11px]"
|
|
330
|
+
style={{
|
|
331
|
+
lineHeight: 1.3,
|
|
332
|
+
}}
|
|
333
|
+
>
|
|
334
|
+
Empresa y hora a confirmar luego del pago.
|
|
335
|
+
</span>
|
|
336
|
+
</div>
|
|
337
|
+
<div className="flex items-justify gap-[8px]">
|
|
338
|
+
{renderIcon("confirmarIcon", "16px")}
|
|
339
|
+
|
|
340
|
+
<span
|
|
341
|
+
className="text-[11px]"
|
|
342
|
+
style={{
|
|
343
|
+
lineHeight: 1.3,
|
|
344
|
+
}}
|
|
345
|
+
>
|
|
346
|
+
Tu compra está 100% asegurada.
|
|
347
|
+
</span>
|
|
348
|
+
</div>
|
|
349
|
+
</div>
|
|
350
|
+
</div>
|
|
351
|
+
|
|
352
|
+
{/* MIDDLE: competing operators + viewers */}
|
|
353
|
+
<div className="min-w-0 px-[22px] flex flex-col items-center justify-between gap-[16px] py-[2px] border-r border-[#363c48] border-l border-[#363c48]">
|
|
354
|
+
<div className="text-center">
|
|
355
|
+
<div className="bold-text text-[14px]">
|
|
356
|
+
{operatorsCompetingCount} operadores compitiendo
|
|
357
|
+
<br /> por tu compra
|
|
358
|
+
</div>
|
|
359
|
+
</div>
|
|
360
|
+
|
|
361
|
+
<div className="grid w-full grid-cols-3 items-stretch gap-[14px] ">
|
|
362
|
+
{operators.map((op, idx) => (
|
|
363
|
+
<div
|
|
364
|
+
key={idx}
|
|
365
|
+
className="flex min-w-0 flex-col items-center justify-center gap-[8px] rounded-[8px]"
|
|
366
|
+
style={{
|
|
367
|
+
// height: "80px",
|
|
368
|
+
border: "1px solid #363c48",
|
|
369
|
+
backgroundColor: "#1a202e",
|
|
370
|
+
padding: "14px 10px",
|
|
371
|
+
}}
|
|
372
|
+
>
|
|
373
|
+
<img
|
|
374
|
+
src={op.logo}
|
|
375
|
+
alt={op.name}
|
|
376
|
+
onError={(e) => {
|
|
377
|
+
e.currentTarget.src = serviceItem?.operator_details?.[0] || "/images/service-list/bus-icon.svg";
|
|
378
|
+
}}
|
|
379
|
+
className={`h-[24px] max-w-full object-contain ${isSoldOut ? "grayscale" : ""
|
|
380
|
+
}`}
|
|
381
|
+
/>
|
|
382
|
+
<span className="text-[11px] truncate max-w-full text-center">
|
|
383
|
+
{op.name}
|
|
384
|
+
</span>
|
|
385
|
+
<div className="bg-[#FF8F45] text-white text-[12px] font-bold px-[10px] py-[4px] rounded-[4px] bold-text whitespace-nowrap">
|
|
386
|
+
<span>{op?.time}</span>
|
|
387
|
+
</div>
|
|
388
|
+
<span className="text-[10px] mt-[6px]">
|
|
389
|
+
{op?.seatsAvailable}
|
|
390
|
+
</span>
|
|
391
|
+
</div>
|
|
392
|
+
))}
|
|
393
|
+
</div>
|
|
394
|
+
|
|
395
|
+
<div
|
|
396
|
+
className="flex w-full items-center justify-center gap-[6px] text-[12px]"
|
|
397
|
+
style={{
|
|
398
|
+
padding: "8px 14px",
|
|
399
|
+
marginBottom: "6px",
|
|
400
|
+
}}
|
|
401
|
+
>
|
|
402
|
+
<LottiePlayer
|
|
403
|
+
// animationData={serviceItem.icons.flexibleAnim}
|
|
404
|
+
animationData={getAnimationIcon("usersAnimation")}
|
|
405
|
+
width="18px"
|
|
406
|
+
height="18px"
|
|
407
|
+
/>
|
|
408
|
+
<span className="text-[13px]">
|
|
409
|
+
<span className="bold-text text-white">
|
|
410
|
+
<span
|
|
411
|
+
className="bold-text"
|
|
412
|
+
ref={(node) =>
|
|
413
|
+
commonService.startViewerCount(node, viewersConfig)
|
|
414
|
+
}
|
|
415
|
+
style={{
|
|
416
|
+
fontVariantNumeric: "tabular-nums",
|
|
417
|
+
color: "#FF5C60",
|
|
418
|
+
}}
|
|
419
|
+
/>{" "}
|
|
420
|
+
</span>
|
|
421
|
+
|
|
422
|
+
<span style={{ color: "#FF5C60" }}>viendo</span> |{" "}
|
|
423
|
+
|
|
424
|
+
<span
|
|
425
|
+
className="bold-text"
|
|
426
|
+
ref={(node) =>
|
|
427
|
+
commonService.startComprandoCount(node, 4, 16)
|
|
428
|
+
}
|
|
429
|
+
style={{ fontVariantNumeric: "tabular-nums" }}
|
|
430
|
+
/>{" "}
|
|
431
|
+
han comprado
|
|
432
|
+
</span>
|
|
433
|
+
</div>
|
|
434
|
+
</div>
|
|
435
|
+
|
|
436
|
+
{/* RIGHT: price + button */}
|
|
437
|
+
<div className="flex flex-col justify-center gap-[12px] py-[2px] pl-[22px] pr-[10px] relative mb-[16px]">
|
|
438
|
+
<div
|
|
439
|
+
className="flex flex-col gap-[6px] "
|
|
440
|
+
style={{
|
|
441
|
+
alignItems: "center",
|
|
442
|
+
}}
|
|
443
|
+
>
|
|
444
|
+
<span
|
|
445
|
+
className="text-[#FF8F45] bold-text text-[26px] leading-tight"
|
|
446
|
+
style={{
|
|
447
|
+
animation: "pulse-zoom 2s ease-in-out infinite",
|
|
448
|
+
whiteSpace: "nowrap",
|
|
449
|
+
}}
|
|
450
|
+
>
|
|
451
|
+
{savingsPercent}% OFF
|
|
452
|
+
</span>
|
|
453
|
+
{/* <span className="text-[#666] text-[14px] line-through">
|
|
454
|
+
$10.000
|
|
455
|
+
</span> */}
|
|
456
|
+
<span
|
|
457
|
+
className="text-[13.33px] font-normal leading-[20px] text-[#9f9f9f] relative"
|
|
458
|
+
style={{ position: "relative" }}
|
|
459
|
+
>
|
|
460
|
+
{`$${(originalPrice * ticketQuantity).toLocaleString()}`}
|
|
461
|
+
<span
|
|
462
|
+
style={{
|
|
463
|
+
position: "absolute",
|
|
464
|
+
left: "-2px",
|
|
465
|
+
top: "50%",
|
|
466
|
+
width: "calc(100% + 4px)",
|
|
467
|
+
height: "1px",
|
|
468
|
+
|
|
469
|
+
backgroundColor: "#FF5C60",
|
|
470
|
+
|
|
471
|
+
transform: "rotate(-10deg)",
|
|
472
|
+
transformOrigin: "center",
|
|
473
|
+
}}
|
|
474
|
+
/>
|
|
475
|
+
</span>
|
|
476
|
+
<span className="text-white bold-text text-[28px] leading-none">
|
|
477
|
+
{`$${(finalPrice * ticketQuantity).toLocaleString()}`}
|
|
478
|
+
</span>
|
|
479
|
+
</div>
|
|
480
|
+
|
|
481
|
+
<div className="mt-[4px] flex flex-col items-center gap-[8px]">
|
|
482
|
+
<span className="text-[12px] text-white">
|
|
483
|
+
¿Cuántos pasajes quieres?
|
|
484
|
+
</span>
|
|
485
|
+
<div
|
|
486
|
+
className="flex w-full items-center justify-between rounded-[16px] "
|
|
487
|
+
style={{
|
|
488
|
+
border: "1px solid #363c48",
|
|
489
|
+
backgroundColor: "#1a202e",
|
|
490
|
+
padding: "4px 14px",
|
|
491
|
+
}}
|
|
492
|
+
>
|
|
493
|
+
<button
|
|
494
|
+
type="button"
|
|
495
|
+
aria-label="Disminuir pasajes"
|
|
496
|
+
disabled={!canDecreaseTicketQuantity}
|
|
497
|
+
onClick={() => onDecreaseTicketQuantity?.(serviceItem)}
|
|
498
|
+
className={`flex h-[26px] w-[26px] items-center justify-center rounded-full border-none text-[16px] leading-none text-white ${canDecreaseTicketQuantity
|
|
499
|
+
? "cursor-pointer bg-[#2d374d]"
|
|
500
|
+
: "cursor-not-allowed bg-[#222b3d] opacity-50"
|
|
501
|
+
}`}
|
|
502
|
+
>
|
|
503
|
+
-
|
|
504
|
+
</button>
|
|
505
|
+
<span className="bold-text text-[14px] text-white">
|
|
506
|
+
{ticketQuantity}
|
|
507
|
+
</span>
|
|
508
|
+
<button
|
|
509
|
+
type="button"
|
|
510
|
+
aria-label="Aumentar pasajes"
|
|
511
|
+
onClick={() => onIncreaseTicketQuantity?.(serviceItem)}
|
|
512
|
+
className="flex h-[26px] w-[26px] cursor-pointer items-center justify-center rounded-full border-none bg-[#2d374d] text-[16px] leading-none text-white"
|
|
513
|
+
>
|
|
514
|
+
+
|
|
515
|
+
</button>
|
|
516
|
+
</div>
|
|
517
|
+
</div>
|
|
518
|
+
|
|
519
|
+
<button
|
|
520
|
+
type="button"
|
|
521
|
+
onClick={onBookButtonPress}
|
|
522
|
+
className="flex items-center gap-[6px] px-[20px] py-[10px] rounded-[16px] text-white bold-text text-[13px] mt-[4px] justify-center border-none cursor-pointer text-center"
|
|
523
|
+
style={{
|
|
524
|
+
backgroundColor: "#FF5C60",
|
|
525
|
+
whiteSpace: "nowrap",
|
|
526
|
+
}}
|
|
527
|
+
>
|
|
528
|
+
<LottiePlayer
|
|
529
|
+
// animationData={serviceItem.icons.flexibleAnim}
|
|
530
|
+
animationData={getAnimationIcon("thunderAnimation")}
|
|
531
|
+
width="16px"
|
|
532
|
+
height="16px"
|
|
533
|
+
/>
|
|
534
|
+
<span className="whitespace-nowrap">¡Lo quiero!</span>
|
|
535
|
+
</button>
|
|
536
|
+
</div>
|
|
537
|
+
|
|
538
|
+
<div
|
|
539
|
+
className={`absolute bottom-[11px] right-[18px] cursor-pointer transition-transform duration-300 ease-in-out ${isItemExpanded ? "rotate-180" : ""}`}
|
|
540
|
+
onClick={onToggleExpand}
|
|
541
|
+
>
|
|
542
|
+
<img
|
|
543
|
+
src={serviceItem.icons?.downArrow}
|
|
544
|
+
alt="down arrow"
|
|
545
|
+
style={{
|
|
546
|
+
width: "14px",
|
|
547
|
+
height: "8px",
|
|
548
|
+
filter: "brightness(0) invert(1)",
|
|
549
|
+
}}
|
|
550
|
+
/>
|
|
551
|
+
</div>
|
|
552
|
+
</div>
|
|
553
|
+
</div>
|
|
554
|
+
<div
|
|
555
|
+
className="grid"
|
|
556
|
+
style={{
|
|
557
|
+
gridTemplateRows: isItemExpanded ? "1fr" : "0fr",
|
|
558
|
+
opacity: isItemExpanded ? 1 : 0,
|
|
559
|
+
transition:
|
|
560
|
+
"grid-template-rows 300ms ease-in-out, opacity 250ms ease-in-out",
|
|
561
|
+
}}
|
|
562
|
+
>
|
|
563
|
+
<div
|
|
564
|
+
className={`min-h-0 overflow-hidden px-[16px] text-[13.33px] ${isItemExpanded ? "pt-[14px] pb-[6px]" : "py-0"
|
|
565
|
+
}`}
|
|
566
|
+
style={{ transition: "padding 300ms ease-in-out" }}
|
|
567
|
+
>
|
|
568
|
+
<span className="bold-text">¿Cómo funciona?</span>
|
|
569
|
+
|
|
570
|
+
<div className="mt-[14px] grid grid-cols-4 gap-[20px] px-[16px] ">
|
|
571
|
+
{HOW_IT_WORKS_STEPS.map((step) => (
|
|
572
|
+
<div
|
|
573
|
+
key={step.name}
|
|
574
|
+
className="flex flex-col items-center text-center text-[#272727]"
|
|
575
|
+
>
|
|
576
|
+
<FeatureStepIcon icon={step.icon} />
|
|
577
|
+
<span className="bold-text mt-[10px] text-[12px] leading-[14px]">
|
|
578
|
+
{step.name}
|
|
579
|
+
</span>
|
|
580
|
+
<span className="mt-[2px] max-w-[220px] text-[12px] leading-[14px] text-[#4a4a4a]">
|
|
581
|
+
{step.text}
|
|
582
|
+
</span>
|
|
583
|
+
</div>
|
|
584
|
+
))}
|
|
585
|
+
</div>
|
|
586
|
+
</div>
|
|
587
|
+
</div>
|
|
588
|
+
</div>
|
|
589
|
+
|
|
590
|
+
{/* TOP BADGE — "Remate | Termina en 09:55 min" hardcoded, no countdown hook */}
|
|
591
|
+
{/* {showTopLabel && (
|
|
592
|
+
<div className="absolute -top-[11px] left-0 w-full flex items-center justify-end gap-[12px] pr-[15px] z-10 ">
|
|
593
|
+
<div className="flex items-center gap-[6px] py-[5px] px-[14px] rounded-[38px] text-[12.5px] bg-[#FF8F45] text-white whitespace-nowrap">
|
|
594
|
+
<LottiePlayer
|
|
595
|
+
animationData={getAnimationIcon("bombAnimation")}
|
|
596
|
+
width="14px"
|
|
597
|
+
height="14px"
|
|
598
|
+
/>
|
|
599
|
+
<span>
|
|
600
|
+
<strong>Remate</strong> | Termina en{" "}
|
|
601
|
+
<strong>{HARDCODED_COUNTDOWN}</strong> min
|
|
602
|
+
</span>
|
|
603
|
+
</div>
|
|
604
|
+
</div>
|
|
605
|
+
)} */}
|
|
606
|
+
</div>
|
|
607
|
+
);
|
|
608
|
+
};
|
|
609
|
+
|
|
610
|
+
export default FeatureServiceUi;
|