kupos-ui-components-lib 9.3.9 → 9.4.0
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/components/ServiceItem/ServiceItemDesktop.d.ts +1 -1
- package/dist/components/ServiceItem/ServiceItemDesktop.js +36 -34
- package/dist/components/ServiceItem/ServiceItemMobile.js +20 -25
- package/dist/components/ServiceItem/mobileTypes.d.ts +2 -0
- package/dist/components/ServiceItem/types.d.ts +4 -0
- package/dist/styles.css +29 -2
- package/dist/ui/KuposButton/KuposButton.js +2 -1
- package/dist/ui/SeatSection/SeatSection.d.ts +2 -1
- package/dist/ui/SeatSection/SeatSection.js +57 -8
- package/dist/ui/ServiceBadges/ServiceBadges.js +1 -1
- package/dist/ui/mobileweb/DateTimeSectionMobile.d.ts +2 -1
- package/dist/ui/mobileweb/DateTimeSectionMobile.js +2 -2
- package/dist/ui/mobileweb/SeatSectionMobile.d.ts +2 -1
- package/dist/ui/mobileweb/SeatSectionMobile.js +32 -2
- package/dist/ui/mobileweb/ServiceBadgesMobile.js +1 -1
- package/package.json +1 -1
- package/src/components/ServiceItem/ServiceItemDesktop.tsx +74 -47
- package/src/components/ServiceItem/ServiceItemMobile.tsx +67 -66
- package/src/components/ServiceItem/mobileTypes.ts +2 -0
- package/src/components/ServiceItem/types.ts +5 -0
- package/src/ui/KuposButton/KuposButton.tsx +7 -2
- package/src/ui/SeatSection/SeatSection.tsx +83 -7
- package/src/ui/ServiceBadges/ServiceBadges.tsx +1 -1
- package/src/ui/mobileweb/DateTimeSectionMobile.tsx +3 -0
- package/src/ui/mobileweb/SeatSectionMobile.tsx +95 -1
- package/src/ui/mobileweb/ServiceBadgesMobile.tsx +1 -1
|
@@ -42,7 +42,7 @@ const getUniqueSeats = (data, limit) => {
|
|
|
42
42
|
.sort((a, b) => a.fare - b.fare)
|
|
43
43
|
.slice(0, limit);
|
|
44
44
|
};
|
|
45
|
-
function SeatSectionMobile({ seatTypes: seatTypesData, isSoldOut, isPeru, seatPriceColor, currencySign, availableSeats, removeDuplicateSeats, serviceItem, tooltipBgColor, }) {
|
|
45
|
+
function SeatSectionMobile({ seatTypes: seatTypesData, isSoldOut, isPeru, seatPriceColor, currencySign, availableSeats, removeDuplicateSeats, serviceItem, tooltipBgColor, showLastSeats, }) {
|
|
46
46
|
var _a, _b, _c, _d, _e;
|
|
47
47
|
const hasMultipleTypes = ((_a = seatTypesData === null || seatTypesData === void 0 ? void 0 : seatTypesData.length) !== null && _a !== void 0 ? _a : 0) > 2;
|
|
48
48
|
const getFare = (fare) => {
|
|
@@ -73,6 +73,34 @@ function SeatSectionMobile({ seatTypes: seatTypesData, isSoldOut, isPeru, seatPr
|
|
|
73
73
|
React.createElement("span", { className: "min-[420]:text-[13px] text-[12px] bold-text", style: { color: isSoldOut ? "#bbb" : "#464647" } }, "Desde"),
|
|
74
74
|
React.createElement("span", { className: "min-[420]:text-[13px] text-[12px] bold-text", style: { color: priceColor } }, commonService.currency(discountedPrice, currencySign)))));
|
|
75
75
|
};
|
|
76
|
+
const renderDpSeats = () => {
|
|
77
|
+
var _a;
|
|
78
|
+
const lowestFare = getLowestFare();
|
|
79
|
+
if (lowestFare === null)
|
|
80
|
+
return null;
|
|
81
|
+
const { discountedPrice } = commonService.calculateDiscountedPrice(lowestFare, serviceItem);
|
|
82
|
+
const priceColor = isSoldOut ? "#bbb" : tooltipBgColor;
|
|
83
|
+
return (React.createElement("div", { className: "relative flex flex-col justify-center h-full" },
|
|
84
|
+
React.createElement("div", { className: "absolute right-[0px]", style: {
|
|
85
|
+
animation: "pulse-zoom 2s ease-in-out infinite",
|
|
86
|
+
top: (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.available_seats) < 10 &&
|
|
87
|
+
(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.available_seats) > 0
|
|
88
|
+
? "-20px"
|
|
89
|
+
: "-10px",
|
|
90
|
+
} },
|
|
91
|
+
React.createElement("span", { className: "rounded-[100px] px-[8px] text-[11px] bold-text leading-[20px] text-[#fff]", style: {
|
|
92
|
+
backgroundColor: tooltipBgColor,
|
|
93
|
+
} }, "Mejor precio")),
|
|
94
|
+
React.createElement("div", { className: "w-[100%] flex flex-row justify-between items-center" },
|
|
95
|
+
React.createElement("span", { className: "min-[420]:text-[13px] text-[12px]", style: { color: isSoldOut ? "#bbb" : "#464647" } }, "Desde"),
|
|
96
|
+
React.createElement("span", { className: "flex items-center gap-[4px] min-[420]:text-[13px] text-[14px] bold-text", style: { color: priceColor } },
|
|
97
|
+
((_a = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _a === void 0 ? void 0 : _a.fireIcon) ? (React.createElement("img", { src: serviceItem.icons.fireIcon, alt: "dp", className: "h-[14px] w-[14px] object-contain", style: { filter: isSoldOut ? "grayscale(1)" : "" } })) : null,
|
|
98
|
+
commonService.currency(discountedPrice, currencySign))),
|
|
99
|
+
showLastSeats ? (React.createElement("div", { className: "flex justify-end" }, (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.available_seats) < 10 &&
|
|
100
|
+
(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.available_seats) > 0 && (React.createElement("div", { className: "text-[10px] text-[#464647] text-center mt-[3px]" }, "\u00A1\u00DAltimos Asientos!")))) : null,
|
|
101
|
+
isSoldOut ? (React.createElement("div", { className: "flex justify-end" },
|
|
102
|
+
React.createElement("span", { className: "min-[420]:text-[13px] text-[12px] text-[#ccc]" }, "Agotado"))) : null));
|
|
103
|
+
};
|
|
76
104
|
const renderSeats = () => {
|
|
77
105
|
var _a, _b, _c;
|
|
78
106
|
if (isPeru) {
|
|
@@ -102,7 +130,7 @@ function SeatSectionMobile({ seatTypes: seatTypesData, isSoldOut, isPeru, seatPr
|
|
|
102
130
|
typeof (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.discount_value) === "number"
|
|
103
131
|
? Math.round(serviceItem.discount_value)
|
|
104
132
|
: null;
|
|
105
|
-
return (React.createElement("div", { className: "content-center relative", style: { width: "40%" } }, hasDiscount && discountSeat ? (React.createElement("div", { className: "relative grid grid-cols-[auto_auto] justify-between gap-x-[8px] " },
|
|
133
|
+
return (React.createElement("div", { className: "content-center relative", style: { width: "40%" } }, (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_dp_enabled) ? (React.createElement("div", { className: "flex flex-col justify-between h-[2.5rem]", style: { gap: isSoldOut ? "0px" : "5px" } }, renderDpSeats())) : hasDiscount && discountSeat ? (React.createElement("div", { className: "relative grid grid-cols-[auto_auto] justify-between gap-x-[8px] " },
|
|
106
134
|
discountValue != null && (React.createElement("div", { className: "absolute -top-[18px] right-[0px]", style: {
|
|
107
135
|
animation: "pulse-zoom 2s ease-in-out infinite",
|
|
108
136
|
} },
|
|
@@ -137,6 +165,8 @@ function SeatSectionMobile({ seatTypes: seatTypesData, isSoldOut, isPeru, seatPr
|
|
|
137
165
|
justifyContent: hasMultipleTypes ? "space-between" : "center",
|
|
138
166
|
} },
|
|
139
167
|
renderSeats(),
|
|
168
|
+
showLastSeats ? (React.createElement("div", { className: "flex justify-end " }, (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.available_seats) < 10 &&
|
|
169
|
+
(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.available_seats) > 0 && (React.createElement("div", { className: "text-[10px] text-[#464647] text-center" }, "\u00A1 \u00DAltimos Asientos!")))) : null,
|
|
140
170
|
isSoldOut ? (React.createElement("div", { className: "flex justify-end" },
|
|
141
171
|
React.createElement("span", { className: "min-[420]:text-[13px] text-[12px] text-[#ccc]" }, "Agotado"))) : null))));
|
|
142
172
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
const ServiceBadgesMobile = ({ showTopLabel, isSoldOut, colors, renderIcon, serviceItem, isConexion, }) => {
|
|
3
|
-
return (React.createElement("div", { className: "absolute -top-[
|
|
3
|
+
return (React.createElement("div", { className: "absolute -top-[10px] left-0 w-full flex items-center justify-end gap-[12px] pr-[17px] z-10" },
|
|
4
4
|
showTopLabel && (React.createElement("div", { className: `flex items-center gap-[2px] py-[4px] px-[10px] rounded-[38px] min-[420]:text-[12px] text-[10px] z-20`, style: {
|
|
5
5
|
backgroundColor: "#fff",
|
|
6
6
|
border: `1px solid ${colors.topLabelColor}`,
|
package/package.json
CHANGED
|
@@ -105,6 +105,8 @@ function ServiceItemPB({
|
|
|
105
105
|
setIsExpand,
|
|
106
106
|
coachKey,
|
|
107
107
|
viewersConfig,
|
|
108
|
+
showLoginModal,
|
|
109
|
+
isLoggedIn,
|
|
108
110
|
}: ServiceItemProps & { currencySign?: string }): React.ReactElement {
|
|
109
111
|
const getAnimationIcon = (icon: string) => {
|
|
110
112
|
const animation = ANIMATION_MAP[icon];
|
|
@@ -185,15 +187,17 @@ function ServiceItemPB({
|
|
|
185
187
|
);
|
|
186
188
|
|
|
187
189
|
const offerGradient = `linear-gradient(90deg, ${colors.rightGradiantColor || "#ff5964"} 0%, ${colors.leftGradiantColor || "#ff8842"} 100%)`;
|
|
188
|
-
const serviceCardStyle: React.CSSProperties =
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
190
|
+
const serviceCardStyle: React.CSSProperties =
|
|
191
|
+
hasOfferText || serviceItem?.is_dp_enabled
|
|
192
|
+
? {
|
|
193
|
+
borderColor: "transparent",
|
|
194
|
+
borderStyle: "solid",
|
|
195
|
+
borderWidth: "3px 3px 0 3px",
|
|
196
|
+
borderRadius: isItemExpanded || coachKey ? "18px 18px 0 0" : "18px",
|
|
197
|
+
background: `linear-gradient(#fff, #fff) padding-box, ${offerGradient} border-box`,
|
|
198
|
+
zIndex: 2,
|
|
199
|
+
}
|
|
200
|
+
: {};
|
|
197
201
|
|
|
198
202
|
const renderIcon = (iconKey: string, size: string = "14px") => {
|
|
199
203
|
const iconValue = serviceItem.icons?.[iconKey];
|
|
@@ -397,7 +401,7 @@ function ServiceItemPB({
|
|
|
397
401
|
/>
|
|
398
402
|
) : (
|
|
399
403
|
<div
|
|
400
|
-
className={`relative ${hasOfferText ? "mb-[55px]" : "mb-[10px]"} ${
|
|
404
|
+
className={`relative ${hasOfferText || serviceItem?.is_dp_enabled ? "mb-[55px]" : "mb-[10px]"} ${
|
|
401
405
|
serviceItem?.is_direct_trip ||
|
|
402
406
|
serviceItem?.train_type_label === "Tren Express (Nuevo)" ||
|
|
403
407
|
showTopLabel
|
|
@@ -408,7 +412,7 @@ function ServiceItemPB({
|
|
|
408
412
|
<div
|
|
409
413
|
id={`service-card-${serviceItem.id}`}
|
|
410
414
|
className={`bg-white mx-auto relative ${
|
|
411
|
-
hasOfferText
|
|
415
|
+
hasOfferText || serviceItem?.is_dp_enabled
|
|
412
416
|
? "rounded-[18px]"
|
|
413
417
|
: "rounded-[10px] border border-[#ccc]"
|
|
414
418
|
}`}
|
|
@@ -485,6 +489,7 @@ function ServiceItemPB({
|
|
|
485
489
|
availableSeats={serviceItem.available_seats}
|
|
486
490
|
isSoldOut={isSoldOut}
|
|
487
491
|
priceColor={colors.priceColor}
|
|
492
|
+
dpSeatColor={colors.seatPriceColor}
|
|
488
493
|
currencySign={currencySign}
|
|
489
494
|
removeDuplicateSeats={removeDuplicateSeats}
|
|
490
495
|
isPeru={isPeru}
|
|
@@ -521,14 +526,19 @@ function ServiceItemPB({
|
|
|
521
526
|
/>
|
|
522
527
|
{showLastSeats ? (
|
|
523
528
|
<div
|
|
524
|
-
className="flex justify-center mr-[11px] w-[100%] right-[0px]"
|
|
525
|
-
style={{
|
|
526
|
-
|
|
527
|
-
}}
|
|
529
|
+
className="flex justify-center mr-[11px] w-[100%] right-[0px] absolute left-[0] top-[40px]"
|
|
530
|
+
// style={{
|
|
531
|
+
// top: serviceDetailsLoading ? "-17px" : "-20px",
|
|
532
|
+
// }}
|
|
528
533
|
>
|
|
529
534
|
{serviceItem?.available_seats < 10 &&
|
|
530
535
|
serviceItem?.available_seats > 0 && (
|
|
531
|
-
<div
|
|
536
|
+
<div
|
|
537
|
+
className="text-[12px] mt-1 text-center"
|
|
538
|
+
style={{
|
|
539
|
+
color: colors.seatPriceColor,
|
|
540
|
+
}}
|
|
541
|
+
>
|
|
532
542
|
¡Últimos Asientos!
|
|
533
543
|
</div>
|
|
534
544
|
)}
|
|
@@ -565,7 +575,7 @@ function ServiceItemPB({
|
|
|
565
575
|
transition:
|
|
566
576
|
"grid-template-rows 0.3s ease-in-out, opacity 0.25s ease-in-out",
|
|
567
577
|
position: "relative",
|
|
568
|
-
zIndex:
|
|
578
|
+
zIndex: 1,
|
|
569
579
|
}}
|
|
570
580
|
>
|
|
571
581
|
<div
|
|
@@ -573,10 +583,10 @@ function ServiceItemPB({
|
|
|
573
583
|
overflow: "hidden",
|
|
574
584
|
minHeight: 0,
|
|
575
585
|
marginTop: "-10px",
|
|
576
|
-
...(hasOfferText
|
|
586
|
+
...(hasOfferText || serviceItem?.is_dp_enabled
|
|
577
587
|
? {
|
|
578
|
-
borderLeft: "
|
|
579
|
-
borderRight: "
|
|
588
|
+
borderLeft: "3px solid #ff5964",
|
|
589
|
+
borderRight: "3px solid #ff8842",
|
|
580
590
|
borderRadius: "0 0 18px 18px",
|
|
581
591
|
boxSizing: "border-box",
|
|
582
592
|
}
|
|
@@ -596,9 +606,9 @@ function ServiceItemPB({
|
|
|
596
606
|
|
|
597
607
|
{children}
|
|
598
608
|
{/* Bottom discount banner */}
|
|
599
|
-
{serviceItem?.offer_text && (
|
|
609
|
+
{(serviceItem?.offer_text || serviceItem?.is_dp_enabled) && (
|
|
600
610
|
<div
|
|
601
|
-
className="text-white p-[10px_15px] text-left w-full flex items-center absolute -bottom-[36px] pt-[50px]
|
|
611
|
+
className="text-white p-[10px_15px] text-left w-full flex items-center absolute -bottom-[36px] pt-[50px] rounded-b-[14px] text-[14px]"
|
|
602
612
|
style={{
|
|
603
613
|
background: offerGradient,
|
|
604
614
|
opacity: isSoldOut ? 0.5 : 1,
|
|
@@ -606,31 +616,48 @@ function ServiceItemPB({
|
|
|
606
616
|
>
|
|
607
617
|
<div className="flex justify-between items-center w-full">
|
|
608
618
|
<div className="flex items-center ">
|
|
609
|
-
|
|
610
|
-
<
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
<div className="flex items-center
|
|
616
|
-
<
|
|
617
|
-
{(
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
</span>{" "}
|
|
622
|
-
| Termina en
|
|
623
|
-
<span
|
|
624
|
-
className="bold-text text-end"
|
|
625
|
-
ref={(node) => CommonService.startCountdown(node, 599)}
|
|
626
|
-
style={{
|
|
627
|
-
fontVariantNumeric: "tabular-nums",
|
|
628
|
-
display: "inline-block",
|
|
629
|
-
// minWidth: "70px",
|
|
630
|
-
}}
|
|
619
|
+
{serviceItem?.is_dp_enabled ? (
|
|
620
|
+
<div className="flex items-center gap-[3px]">
|
|
621
|
+
{renderIcon("whiteFireIcon", "14px")}
|
|
622
|
+
<span>Servicio popular entre los usuarios</span>
|
|
623
|
+
</div>
|
|
624
|
+
) : (
|
|
625
|
+
<div className="flex items-center">
|
|
626
|
+
<LottiePlayer
|
|
627
|
+
animationData={getAnimationIcon("bombAnimation")}
|
|
628
|
+
width="18px"
|
|
629
|
+
height="18px"
|
|
631
630
|
/>
|
|
631
|
+
<div className="flex items-center mt-[2px]">
|
|
632
|
+
<span className="bold-text ml-[6px]">
|
|
633
|
+
{(serviceItem?.offer_text || "").length > 30
|
|
634
|
+
? (serviceItem?.offer_text || "").slice(0, 30) +
|
|
635
|
+
"..."
|
|
636
|
+
: serviceItem?.offer_text || ""}{" "}
|
|
637
|
+
{isLoggedIn ? null : (
|
|
638
|
+
<span
|
|
639
|
+
onClick={showLoginModal}
|
|
640
|
+
className="cursor-pointer"
|
|
641
|
+
>
|
|
642
|
+
registro
|
|
643
|
+
</span>
|
|
644
|
+
)}{" "}
|
|
645
|
+
|
|
646
|
+
</span>{" "}
|
|
647
|
+
| Termina en
|
|
648
|
+
<span
|
|
649
|
+
className="bold-text text-end"
|
|
650
|
+
ref={(node) =>
|
|
651
|
+
CommonService.startCountdown(node, 599)
|
|
652
|
+
}
|
|
653
|
+
style={{
|
|
654
|
+
fontVariantNumeric: "tabular-nums",
|
|
655
|
+
display: "inline-block",
|
|
656
|
+
}}
|
|
657
|
+
/>
|
|
658
|
+
</div>
|
|
632
659
|
</div>
|
|
633
|
-
|
|
660
|
+
)}
|
|
634
661
|
</div>
|
|
635
662
|
<div className="flex items-center">
|
|
636
663
|
{/* {renderIcon("personIcon", "16px")} */}
|
|
@@ -648,12 +675,12 @@ function ServiceItemPB({
|
|
|
648
675
|
}
|
|
649
676
|
style={{ fontVariantNumeric: "tabular-nums" }}
|
|
650
677
|
/>{" "}
|
|
651
|
-
<span className="bold-text">personas</span>{" "}
|
|
678
|
+
{/* <span className="bold-text">personas</span>{" "} */}
|
|
652
679
|
<span>
|
|
653
680
|
{" "}
|
|
654
681
|
{viewersConfig?.label || " viendo"} |{" "}
|
|
655
682
|
<span className="">
|
|
656
|
-
Quedan pocos •
|
|
683
|
+
{serviceItem?.is_dp_enabled ? null : "Quedan pocos • "}
|
|
657
684
|
<span
|
|
658
685
|
className="bold-text"
|
|
659
686
|
ref={(node) =>
|
|
@@ -70,15 +70,16 @@ function ServiceItemMobile({
|
|
|
70
70
|
|
|
71
71
|
const hasOfferText = Boolean(serviceItem?.offer_text);
|
|
72
72
|
const offerGradient = `linear-gradient(90deg, ${colors.rightGradiantColor || "#ff5964"} 0%, ${colors.leftGradiantColor || "#ff8842"} 100%)`;
|
|
73
|
-
const serviceCardStyle: React.CSSProperties =
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
73
|
+
const serviceCardStyle: React.CSSProperties =
|
|
74
|
+
hasOfferText || serviceItem?.is_dp_enabled
|
|
75
|
+
? {
|
|
76
|
+
borderColor: "transparent",
|
|
77
|
+
borderStyle: "solid",
|
|
78
|
+
borderWidth: "3px 3px 0 3px",
|
|
79
|
+
borderRadius: "18px",
|
|
80
|
+
background: `linear-gradient(#fff, #fff) padding-box, ${offerGradient} border-box`,
|
|
81
|
+
}
|
|
82
|
+
: {};
|
|
82
83
|
|
|
83
84
|
const labelId =
|
|
84
85
|
typeof serviceItem.boarding_stages === "string"
|
|
@@ -152,7 +153,7 @@ function ServiceItemMobile({
|
|
|
152
153
|
|
|
153
154
|
return (
|
|
154
155
|
<div
|
|
155
|
-
className={`relative ${!serviceItem.offer_text ? "mb-[14px]" : showTopLabel || serviceItem?.is_direct_trip ? "mb-[20px]" : "mb-[12px]"} ${
|
|
156
|
+
className={`relative ${!serviceItem.offer_text || !serviceItem?.is_dp_enabled ? "mb-[14px]" : showTopLabel || serviceItem?.is_direct_trip ? "mb-[20px]" : "mb-[12px]"} ${
|
|
156
157
|
serviceItem?.is_direct_trip ||
|
|
157
158
|
isConexion ||
|
|
158
159
|
serviceItem?.train_type_label === "Tren Express (Nuevo)" ||
|
|
@@ -164,7 +165,7 @@ function ServiceItemMobile({
|
|
|
164
165
|
>
|
|
165
166
|
<div
|
|
166
167
|
className={`bg-white z-1 ${
|
|
167
|
-
hasOfferText
|
|
168
|
+
hasOfferText || serviceItem?.is_dp_enabled
|
|
168
169
|
? "rounded-[18px]"
|
|
169
170
|
: "rounded-[10px] border border-[#ccc]"
|
|
170
171
|
}`}
|
|
@@ -174,17 +175,17 @@ function ServiceItemMobile({
|
|
|
174
175
|
{/* Header with operator info and favorite */}
|
|
175
176
|
<div className="flex justify-between items-center mb-[10px]">
|
|
176
177
|
<div
|
|
177
|
-
className="flex items-center
|
|
178
|
+
className="flex items-center justify-center gap-x-4"
|
|
178
179
|
style={{
|
|
179
180
|
marginBottom:
|
|
180
181
|
serviceItem?.offer_text || hasDiscount ? "10px" : "",
|
|
181
182
|
}}
|
|
182
183
|
>
|
|
183
|
-
<div className="w-[
|
|
184
|
+
<div className="w-[115px] overflow-y-hidden h-[22px]">
|
|
184
185
|
<img
|
|
185
186
|
src={serviceItem.operator_details[0]}
|
|
186
187
|
alt="service logo"
|
|
187
|
-
className={`w-[100px] h-auto object-contain
|
|
188
|
+
className={`w-[100px] h-auto object-contain ${
|
|
188
189
|
isSoldOut ? "grayscale" : ""
|
|
189
190
|
}`}
|
|
190
191
|
/>
|
|
@@ -194,7 +195,7 @@ function ServiceItemMobile({
|
|
|
194
195
|
{serviceItem?.operator_details[2]}
|
|
195
196
|
</div>
|
|
196
197
|
) : showRating ? (
|
|
197
|
-
<div className="flex min-[420]:text-[13px] text-[12px]
|
|
198
|
+
<div className="flex min-[420]:text-[13px] text-[12px] h-[22px] items-center">
|
|
198
199
|
<div className="flex items-center">
|
|
199
200
|
<div className="flex items-center">
|
|
200
201
|
<img
|
|
@@ -221,16 +222,6 @@ function ServiceItemMobile({
|
|
|
221
222
|
</div>
|
|
222
223
|
) : null}
|
|
223
224
|
</div>
|
|
224
|
-
{showLastSeats ? (
|
|
225
|
-
<div className="flex justify-end ">
|
|
226
|
-
{serviceItem?.available_seats < 10 &&
|
|
227
|
-
serviceItem?.available_seats > 0 && (
|
|
228
|
-
<div className="text-[10px] text-[#464647] text-center">
|
|
229
|
-
¡ Últimos Asientos!
|
|
230
|
-
</div>
|
|
231
|
-
)}
|
|
232
|
-
</div>
|
|
233
|
-
) : null}
|
|
234
225
|
</div>
|
|
235
226
|
|
|
236
227
|
<DateTimeSectionMobile
|
|
@@ -254,7 +245,9 @@ function ServiceItemMobile({
|
|
|
254
245
|
availableSeats={serviceItem.available_seats}
|
|
255
246
|
removeDuplicateSeats={removeDuplicateSeats}
|
|
256
247
|
serviceItem={serviceItem}
|
|
248
|
+
showLastSeats={showLastSeats}
|
|
257
249
|
/>
|
|
250
|
+
|
|
258
251
|
{/* <div className="bg-[#E6E6E6] -ml-[12px] -mr-[12px] mt-[10px] mb-[10px] h-[1px]"></div> */}
|
|
259
252
|
<div className="bg-[#E6E6E6] mt-[10px] mb-[8px] h-[1px]"></div>
|
|
260
253
|
|
|
@@ -296,7 +289,7 @@ function ServiceItemMobile({
|
|
|
296
289
|
</div>
|
|
297
290
|
|
|
298
291
|
{/* 🔹 EXPANDABLE DROPDOWN (below the card) */}
|
|
299
|
-
{serviceItem?.offer_text && (
|
|
292
|
+
{(serviceItem?.offer_text || serviceItem?.is_dp_enabled) && (
|
|
300
293
|
<div
|
|
301
294
|
className="px-[12px] pt-[22px] pb-[8px] relative -z-9 -mt-[15px]"
|
|
302
295
|
style={{
|
|
@@ -311,42 +304,43 @@ function ServiceItemMobile({
|
|
|
311
304
|
style={{ lineHeight: 1.6 }}
|
|
312
305
|
>
|
|
313
306
|
<div className="flex justify-between items-center">
|
|
314
|
-
|
|
315
|
-
className=
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
<LottiePlayer
|
|
319
|
-
animationData={serviceItem.icons.bombAnim}
|
|
320
|
-
width="14px"
|
|
321
|
-
height="14px"
|
|
322
|
-
/>
|
|
307
|
+
{serviceItem?.is_dp_enabled ? (
|
|
308
|
+
<div className="flex items-center">
|
|
309
|
+
{renderIcon("whiteFireIcon", "14px")}
|
|
310
|
+
<span className="text-[#fff]">Más elegido</span>
|
|
323
311
|
</div>
|
|
312
|
+
) : (
|
|
324
313
|
<div
|
|
325
|
-
className={`
|
|
326
|
-
style={{
|
|
327
|
-
color: "#fff",
|
|
328
|
-
lineHeight: 1.4,
|
|
329
|
-
}}
|
|
314
|
+
className={`flex ${(serviceItem?.offer_text || "").length > 10 ? "items-start" : "items-center"}`}
|
|
330
315
|
>
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
<span className="min-[380px]:text-[12px]">|</span>{" "} */}
|
|
337
|
-
<span className="whitespace-nowrap min-[380px]:text-[12px]">
|
|
338
|
-
Termina en
|
|
339
|
-
<span
|
|
340
|
-
className="bold-text"
|
|
341
|
-
ref={(node) => commonService.startCountdown(node, 599)}
|
|
342
|
-
style={{
|
|
343
|
-
fontVariantNumeric: "tabular-nums",
|
|
344
|
-
display: "inline-block",
|
|
345
|
-
}}
|
|
316
|
+
<div className={isLongOfferText ? "mt-[2px]" : ""}>
|
|
317
|
+
<LottiePlayer
|
|
318
|
+
animationData={serviceItem.icons.bombAnim}
|
|
319
|
+
width="14px"
|
|
320
|
+
height="14px"
|
|
346
321
|
/>
|
|
347
|
-
</
|
|
322
|
+
</div>
|
|
323
|
+
<div
|
|
324
|
+
className={`ml-[4px] flex-1 outline-none ${isLongOfferText ? "mt-[2px]" : ""}`}
|
|
325
|
+
style={{
|
|
326
|
+
color: "#fff",
|
|
327
|
+
lineHeight: 1.4,
|
|
328
|
+
}}
|
|
329
|
+
>
|
|
330
|
+
<span className="whitespace-nowrap min-[380px]:text-[12px]">
|
|
331
|
+
Termina en
|
|
332
|
+
<span
|
|
333
|
+
className="bold-text"
|
|
334
|
+
ref={(node) => commonService.startCountdown(node, 599)}
|
|
335
|
+
style={{
|
|
336
|
+
fontVariantNumeric: "tabular-nums",
|
|
337
|
+
display: "inline-block",
|
|
338
|
+
}}
|
|
339
|
+
/>
|
|
340
|
+
</span>
|
|
341
|
+
</div>
|
|
348
342
|
</div>
|
|
349
|
-
|
|
343
|
+
)}
|
|
350
344
|
<div
|
|
351
345
|
className="flex flex-col items-end"
|
|
352
346
|
style={{
|
|
@@ -370,17 +364,23 @@ function ServiceItemMobile({
|
|
|
370
364
|
}
|
|
371
365
|
style={{ fontVariantNumeric: "tabular-nums" }}
|
|
372
366
|
/>{" "}
|
|
373
|
-
<span
|
|
374
|
-
<span>
|
|
375
|
-
{" "}
|
|
376
|
-
|
|
377
|
-
|
|
367
|
+
<span> viendo</span> |{" "}
|
|
368
|
+
<span className="whitespace-nowrap">
|
|
369
|
+
{/* {serviceItem?.is_dp_enabled ? null : "Quedan pocos • "} */}
|
|
370
|
+
<span
|
|
371
|
+
className="bold-text"
|
|
372
|
+
ref={(node) =>
|
|
373
|
+
commonService.startComprandoCount(node, 4, 16)
|
|
374
|
+
}
|
|
375
|
+
style={{ fontVariantNumeric: "tabular-nums" }}
|
|
376
|
+
/>{" "}
|
|
377
|
+
comprando
|
|
378
378
|
</span>
|
|
379
379
|
</span>
|
|
380
380
|
</div>
|
|
381
|
-
<div className="flex items-center">
|
|
381
|
+
{/* <div className="flex items-center">
|
|
382
382
|
<span className="whitespace-nowrap">
|
|
383
|
-
Quedan pocos •
|
|
383
|
+
{serviceItem?.is_dp_enabled ? null : "Quedan pocos • "}
|
|
384
384
|
<span
|
|
385
385
|
className="bold-text"
|
|
386
386
|
ref={(node) =>
|
|
@@ -390,7 +390,7 @@ function ServiceItemMobile({
|
|
|
390
390
|
/>{" "}
|
|
391
391
|
comprando
|
|
392
392
|
</span>
|
|
393
|
-
</div>
|
|
393
|
+
</div> */}
|
|
394
394
|
</div>
|
|
395
395
|
</div>
|
|
396
396
|
{/* <div className="flex flex-col gap-[4px]">
|
|
@@ -460,7 +460,8 @@ function ServiceItemMobile({
|
|
|
460
460
|
transition:
|
|
461
461
|
"grid-template-rows 0.3s ease-in-out, opacity 0.25s ease-in-out",
|
|
462
462
|
position: "relative",
|
|
463
|
-
zIndex:
|
|
463
|
+
zIndex:
|
|
464
|
+
serviceItem?.offer_text || serviceItem?.is_dp_enabled ? -2 : -1,
|
|
464
465
|
}}
|
|
465
466
|
>
|
|
466
467
|
<div
|
|
@@ -37,6 +37,7 @@ export interface MobileServiceItemProps {
|
|
|
37
37
|
change_ticket_hours?: number;
|
|
38
38
|
duration?: number;
|
|
39
39
|
train_type_label?: string;
|
|
40
|
+
is_dp_enabled?: boolean;
|
|
40
41
|
offer_text?: string;
|
|
41
42
|
is_direct_trip?: boolean;
|
|
42
43
|
is_train_type?: boolean;
|
|
@@ -120,6 +121,7 @@ export interface MobileServiceItemProps {
|
|
|
120
121
|
specialDeparture?: string;
|
|
121
122
|
fireIcon?: string;
|
|
122
123
|
directoIcon?: string;
|
|
124
|
+
whiteFireIcon?: string
|
|
123
125
|
[key: string]: string | Record<string, string | undefined> | undefined;
|
|
124
126
|
};
|
|
125
127
|
useLottieFor?: string[];
|
|
@@ -40,6 +40,7 @@ export interface ServiceItemProps {
|
|
|
40
40
|
train_type_label?: string;
|
|
41
41
|
offer_text?: string;
|
|
42
42
|
is_direct_trip?: boolean;
|
|
43
|
+
is_dp_enabled?: boolean;
|
|
43
44
|
is_transpordo?: boolean;
|
|
44
45
|
is_train_type?: boolean;
|
|
45
46
|
operator_service_name?: string;
|
|
@@ -121,6 +122,7 @@ export interface ServiceItemProps {
|
|
|
121
122
|
bombJson?:string
|
|
122
123
|
downArrow?:string
|
|
123
124
|
personIcon?: string
|
|
125
|
+
whiteFireIcon?: string
|
|
124
126
|
|
|
125
127
|
[key: string]: string | Record<string, string | undefined> | undefined;
|
|
126
128
|
};
|
|
@@ -212,4 +214,7 @@ export interface ServiceItemProps {
|
|
|
212
214
|
label?: string; // e.g. "personas están viendo este viaje"
|
|
213
215
|
icon?: string; // optional icon URL
|
|
214
216
|
};
|
|
217
|
+
showLoginModal?: any
|
|
218
|
+
isLoggedIn?: any
|
|
219
|
+
|
|
215
220
|
}
|
|
@@ -37,9 +37,14 @@ function KuposButton({
|
|
|
37
37
|
{isLoading ? (
|
|
38
38
|
<span className="loader-circle"></span>
|
|
39
39
|
) : !isSoldOut ? (
|
|
40
|
-
|
|
40
|
+
<span className="normal-case">
|
|
41
|
+
{buyLabel.charAt(0).toUpperCase() + buyLabel.slice(1).toLowerCase()}
|
|
42
|
+
</span>
|
|
41
43
|
) : (
|
|
42
|
-
|
|
44
|
+
<span className="normal-case">
|
|
45
|
+
{soldOutLabel.charAt(0).toUpperCase() +
|
|
46
|
+
soldOutLabel.slice(1).toLowerCase()}
|
|
47
|
+
</span>
|
|
43
48
|
)}
|
|
44
49
|
</span>
|
|
45
50
|
</button>
|