kupos-ui-components-lib 9.11.4 → 9.11.6
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 +6 -24
- package/dist/components/ServiceItem/ServiceItemMobile.d.ts +1 -1
- package/dist/components/ServiceItem/ServiceItemMobile.js +1 -1
- package/dist/components/ServiceItem/mobileTypes.d.ts +0 -1
- package/dist/components/ServiceItem/types.d.ts +0 -7
- package/dist/styles.css +11 -6
- package/dist/ui/BottomAmenities/BottomAmenities.d.ts +1 -2
- package/dist/ui/BottomAmenities/BottomAmenities.js +2 -4
- package/dist/ui/DateTimeSection/DateTimeSection.js +4 -4
- package/dist/ui/FeatureServiceUI/FeatureServiceUi.js +5 -5
- package/dist/ui/SeatSection/SeatSection.d.ts +1 -7
- package/dist/ui/SeatSection/SeatSection.js +15 -47
- package/dist/ui/mobileweb/DateTimeSectionMobile.d.ts +1 -2
- package/dist/ui/mobileweb/DateTimeSectionMobile.js +7 -13
- package/dist/ui/mobileweb/SeatSectionMobile.d.ts +1 -2
- package/dist/ui/mobileweb/SeatSectionMobile.js +16 -23
- package/dist/utils/CommonService.d.ts +1 -1
- package/dist/utils/CommonService.js +2 -6
- package/package.json +1 -1
- package/src/components/ServiceItem/ServiceItemDesktop.tsx +3 -49
- package/src/components/ServiceItem/ServiceItemMobile.tsx +1 -2
- package/src/components/ServiceItem/mobileTypes.ts +26 -31
- package/src/components/ServiceItem/types.ts +0 -12
- package/src/ui/BottomAmenities/BottomAmenities.tsx +1 -5
- package/src/ui/DateTimeSection/DateTimeSection.tsx +4 -4
- package/src/ui/FeatureServiceUI/FeatureServiceUi.tsx +8 -5
- package/src/ui/SeatSection/SeatSection.tsx +26 -94
- package/src/ui/mobileweb/DateTimeSectionMobile.tsx +34 -47
- package/src/ui/mobileweb/SeatSectionMobile.tsx +14 -28
- package/src/utils/CommonService.ts +2 -8
|
@@ -11,7 +11,7 @@ const EXCEPTIONS = [
|
|
|
11
11
|
"blanco",
|
|
12
12
|
"asiento_mascota",
|
|
13
13
|
];
|
|
14
|
-
const SeatRow = ({ type, index, displayLabel, fare, isSoldOut, seatPriceColor, hasMultipleTypes, textSize,
|
|
14
|
+
const SeatRow = ({ type, index, displayLabel, fare, isSoldOut, seatPriceColor, hasMultipleTypes, textSize, }) => {
|
|
15
15
|
if (EXCEPTIONS.includes(type.label))
|
|
16
16
|
return null;
|
|
17
17
|
const rowClass = hasMultipleTypes
|
|
@@ -20,9 +20,7 @@ const SeatRow = ({ type, index, displayLabel, fare, isSoldOut, seatPriceColor, h
|
|
|
20
20
|
const labelColor = isSoldOut ? "#bbb" : "#464647";
|
|
21
21
|
const priceColor = isSoldOut ? "#bbb" : seatPriceColor;
|
|
22
22
|
return (React.createElement("div", { className: rowClass, key: index },
|
|
23
|
-
React.createElement("span", { className: `min-[420]:text-[13px] ${textSize} `, style: { color: labelColor } },
|
|
24
|
-
? commonService.truncateSeatLabel(commonService.capitalize(displayLabel), 8)
|
|
25
|
-
: displayLabel),
|
|
23
|
+
React.createElement("span", { className: `min-[420]:text-[13px] ${textSize} `, style: { color: labelColor } }, displayLabel),
|
|
26
24
|
React.createElement("span", { className: `min-[420]:text-[13px] ${textSize} bold-text`, style: { color: priceColor } }, fare)));
|
|
27
25
|
};
|
|
28
26
|
const getFilteredSeats = (item) => {
|
|
@@ -44,8 +42,8 @@ const getUniqueSeats = (data, limit) => {
|
|
|
44
42
|
.sort((a, b) => a.fare - b.fare)
|
|
45
43
|
.slice(0, limit);
|
|
46
44
|
};
|
|
47
|
-
function SeatSectionMobile({ seatTypes: seatTypesData, isSoldOut, isPeru, seatPriceColor, currencySign, availableSeats, removeDuplicateSeats, serviceItem, tooltipBgColor, showLastSeats, discountSeatPriceColor,
|
|
48
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
45
|
+
function SeatSectionMobile({ seatTypes: seatTypesData, isSoldOut, isPeru, seatPriceColor, currencySign, availableSeats, removeDuplicateSeats, serviceItem, tooltipBgColor, showLastSeats, discountSeatPriceColor, }) {
|
|
46
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
49
47
|
const hasMultipleTypes = ((_a = seatTypesData === null || seatTypesData === void 0 ? void 0 : seatTypesData.length) !== null && _a !== void 0 ? _a : 0) > 2;
|
|
50
48
|
const getFare = (fare) => {
|
|
51
49
|
if (removeDuplicateSeats && availableSeats <= 0 && !isPeru) {
|
|
@@ -66,7 +64,7 @@ function SeatSectionMobile({ seatTypes: seatTypesData, isSoldOut, isPeru, seatPr
|
|
|
66
64
|
if (lowestFare === null)
|
|
67
65
|
return null;
|
|
68
66
|
const priceColor = isSoldOut ? "#bbb" : seatPriceColor;
|
|
69
|
-
const isMovilBus = (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.operator_service_name) === "MovilBus";
|
|
67
|
+
const isMovilBus = (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.operator_service_name) === "MovilBus" || "Movil Bus";
|
|
70
68
|
// Fetch ALL unique seats (no slice limit) for the multi-row MovilBus case
|
|
71
69
|
const uniqueSeats = getUniqueSeats(seatTypesData !== null && seatTypesData !== void 0 ? seatTypesData : [], Infinity);
|
|
72
70
|
// MovilBus + multiple unique seat types → render a row per seat
|
|
@@ -74,7 +72,7 @@ function SeatSectionMobile({ seatTypes: seatTypesData, isSoldOut, isPeru, seatPr
|
|
|
74
72
|
return (React.createElement(React.Fragment, null, uniqueSeats.map((seat, key) => {
|
|
75
73
|
const { discountedPrice } = commonService.calculateDiscountedPrice(Number(seat.fare), serviceItem);
|
|
76
74
|
return (React.createElement("div", { key: key, className: "w-[100%] flex flex-row justify-between items-center" },
|
|
77
|
-
React.createElement("span", { className: "min-[420]:text-[13px] text-[12px] bold-text
|
|
75
|
+
React.createElement("span", { className: "min-[420]:text-[13px] text-[12px] bold-text", style: { color: isSoldOut ? "#bbb" : "#464647" } }, commonService.truncateSeatLabel(seat.label)),
|
|
78
76
|
React.createElement("span", { className: "min-[420]:text-[13px] text-[12px] bold-text", style: { color: priceColor } }, commonService.currency(discountedPrice, currencySign))));
|
|
79
77
|
})));
|
|
80
78
|
}
|
|
@@ -119,24 +117,19 @@ function SeatSectionMobile({ seatTypes: seatTypesData, isSoldOut, isPeru, seatPr
|
|
|
119
117
|
React.createElement("span", { className: "min-[420]:text-[13px] text-[12px] text-[#464647]", style: { opacity: isSoldOut ? 0.5 : 1 } }, "Agotado"))) : null));
|
|
120
118
|
};
|
|
121
119
|
const renderSeats = () => {
|
|
122
|
-
var _a, _b;
|
|
120
|
+
var _a, _b, _c;
|
|
123
121
|
if (isPeru) {
|
|
124
122
|
return renderPeruSeats();
|
|
125
123
|
}
|
|
126
124
|
if (removeDuplicateSeats) {
|
|
127
125
|
const uniqueSeats = getUniqueSeats(seatTypesData, 3);
|
|
128
|
-
return uniqueSeats.map((type, i) => (React.createElement(SeatRow, { key: i, type: type, index: i, displayLabel: commonService.truncateSeatLabel(type.label), fare: getFare(type.fare), isSoldOut: isSoldOut, seatPriceColor: seatPriceColor, hasMultipleTypes: hasMultipleTypes, textSize: "text-[11px]"
|
|
126
|
+
return uniqueSeats.map((type, i) => (React.createElement(SeatRow, { key: i, type: type, index: i, displayLabel: commonService.truncateSeatLabel(type.label), fare: getFare(type.fare), isSoldOut: isSoldOut, seatPriceColor: seatPriceColor, hasMultipleTypes: hasMultipleTypes, textSize: "text-[11px]" })));
|
|
129
127
|
}
|
|
130
|
-
|
|
131
|
-
return (_b = (isTrain ? filteredSeats : filteredSeats === null || filteredSeats === void 0 ? void 0 : filteredSeats.slice(0, 2))) === null || _b === void 0 ? void 0 : _b.map((type, i) => (React.createElement(SeatRow, { key: i, type: type, index: i, displayLabel: type.label, fare: getFare(type.fare), isSoldOut: isSoldOut, seatPriceColor: seatPriceColor, hasMultipleTypes: hasMultipleTypes, textSize: "text-[12px]", isTrain: isTrain })));
|
|
128
|
+
return (_c = (_b = (_a = seatTypesData === null || seatTypesData === void 0 ? void 0 : seatTypesData.filter((item) => getFilteredSeats(item.label))) === null || _a === void 0 ? void 0 : _a.sort((a, b) => a.fare - b.fare)) === null || _b === void 0 ? void 0 : _b.slice(0, 2)) === null || _c === void 0 ? void 0 : _c.map((type, i) => (React.createElement(SeatRow, { key: i, type: type, index: i, displayLabel: type.label, fare: getFare(type.fare), isSoldOut: isSoldOut, seatPriceColor: seatPriceColor, hasMultipleTypes: hasMultipleTypes, textSize: "text-[12px]" })));
|
|
132
129
|
};
|
|
133
130
|
const seats = removeDuplicateSeats
|
|
134
131
|
? getUniqueSeats(seatTypesData, 3)
|
|
135
|
-
: (() =>
|
|
136
|
-
var _a;
|
|
137
|
-
const filtered = (_a = seatTypesData === null || seatTypesData === void 0 ? void 0 : seatTypesData.filter((item) => getFilteredSeats(item.label))) === null || _a === void 0 ? void 0 : _a.sort((a, b) => a.fare - b.fare);
|
|
138
|
-
return isTrain ? filtered : filtered === null || filtered === void 0 ? void 0 : filtered.slice(0, 2);
|
|
139
|
-
})();
|
|
132
|
+
: (_c = (_b = seatTypesData === null || seatTypesData === void 0 ? void 0 : seatTypesData.filter((item) => getFilteredSeats(item.label))) === null || _b === void 0 ? void 0 : _b.sort((a, b) => a.fare - b.fare)) === null || _c === void 0 ? void 0 : _c.slice(0, 2);
|
|
140
133
|
const discountedSeats = seats === null || seats === void 0 ? void 0 : seats.map((seat) => (Object.assign(Object.assign({}, seat), commonService.calculateDiscountedPrice(seat.fare, serviceItem))));
|
|
141
134
|
const peruLowestFare = isPeru ? getLowestFare() : null;
|
|
142
135
|
const peruDiscountCalc = isPeru && peruLowestFare != null
|
|
@@ -147,7 +140,7 @@ function SeatSectionMobile({ seatTypes: seatTypesData, isSoldOut, isPeru, seatPr
|
|
|
147
140
|
peruDiscountCalc.originalPrice !== peruDiscountCalc.discountedPrice
|
|
148
141
|
: discountedSeats === null || discountedSeats === void 0 ? void 0 : discountedSeats.some((s) => s.originalPrice !== s.discountedPrice);
|
|
149
142
|
const discountSeat = isPeru && peruDiscountCalc
|
|
150
|
-
? Object.assign({ label: "", fare: peruLowestFare }, peruDiscountCalc) : (
|
|
143
|
+
? Object.assign({ label: "", fare: peruLowestFare }, peruDiscountCalc) : (_d = discountedSeats === null || discountedSeats === void 0 ? void 0 : discountedSeats.filter((seat) => !EXCEPTIONS.includes(seat.label))) === null || _d === void 0 ? void 0 : _d.sort((a, b) => a.discountedPrice - b.discountedPrice)[0];
|
|
151
144
|
const discountValue = (() => {
|
|
152
145
|
if ((serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.discount_type) === "percentage" &&
|
|
153
146
|
typeof (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.discount_value) === "number") {
|
|
@@ -183,14 +176,14 @@ function SeatSectionMobile({ seatTypes: seatTypesData, isSoldOut, isPeru, seatPr
|
|
|
183
176
|
};
|
|
184
177
|
const originalDpPrice = getMinValue(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.original_dp_price);
|
|
185
178
|
const dpDiscountPercent = getMinValue(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.dp_discount_percents);
|
|
186
|
-
const firstSeatFare = (
|
|
179
|
+
const firstSeatFare = (_f = (_e = seatTypesData === null || seatTypesData === void 0 ? void 0 : seatTypesData.filter((item) => getFilteredSeats(item.label) && !EXCEPTIONS.includes(item.label))) === null || _e === void 0 ? void 0 : _e.sort((a, b) => a.fare - b.fare)[0]) === null || _f === void 0 ? void 0 : _f.fare;
|
|
187
180
|
const hasDpDiscount = (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.dp_discounted_seats) &&
|
|
188
181
|
(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.dp_discount_percents) &&
|
|
189
182
|
originalDpPrice != null &&
|
|
190
183
|
dpDiscountPercent != null &&
|
|
191
184
|
firstSeatFare != null;
|
|
192
185
|
return (React.createElement("div", { className: "content-center relative", style: { width: "40%" } }, (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_dp_enabled) &&
|
|
193
|
-
!((
|
|
186
|
+
!((_g = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.dp_discounted_seats) === null || _g === void 0 ? void 0 : _g.length) &&
|
|
194
187
|
!dpDiscountPercent ? (React.createElement("div", { className: "flex flex-col justify-between h-[2.5rem]", style: { gap: isSoldOut ? "0px" : "5px" } }, renderDpSeats())) : hasDpDiscount ? (React.createElement("div", { className: "relative grid grid-cols-[auto_auto] justify-between gap-x-[8px] " },
|
|
195
188
|
!isNaN(Number(dpDiscountPercent)) &&
|
|
196
189
|
Number(dpDiscountPercent) > 0 && (React.createElement("div", { className: "absolute -top-[18px] right-[0px]", style: {
|
|
@@ -222,7 +215,7 @@ function SeatSectionMobile({ seatTypes: seatTypesData, isSoldOut, isPeru, seatPr
|
|
|
222
215
|
React.createElement("span", { className: "flex items-center justify-end gap-[4px] text-[14px] bold-text leading-[24px]", style: {
|
|
223
216
|
color: isSoldOut ? "#bbb" : discountSeatPriceColor || "#ff5964",
|
|
224
217
|
} },
|
|
225
|
-
((
|
|
218
|
+
((_h = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _h === void 0 ? void 0 : _h.fireIcon) ? (React.createElement("img", { src: serviceItem.icons.fireIcon, alt: "discount", className: "h-[16px] w-[16px] object-contain", style: { filter: isSoldOut ? "grayscale" : "" } })) : null,
|
|
226
219
|
commonService.discountedCurrency(Number(firstSeatFare), currencySign)),
|
|
227
220
|
isSoldOut ? (React.createElement("span", { className: "col-span-2 min-[420]:text-[13px] text-right text-[12px] text-[#ccc]" }, "Agotado")) : null)) : hasDiscount && discountSeat ? (React.createElement("div", null,
|
|
228
221
|
React.createElement("div", { className: "relative grid grid-cols-[auto_auto] justify-between gap-x-[8px] " },
|
|
@@ -256,8 +249,8 @@ function SeatSectionMobile({ seatTypes: seatTypesData, isSoldOut, isPeru, seatPr
|
|
|
256
249
|
React.createElement("span", { className: "flex items-center justify-end gap-[4px] text-[14px] bold-text leading-[24px]", style: {
|
|
257
250
|
color: isSoldOut ? "#bbb" : discountSeatPriceColor || "#ff5964",
|
|
258
251
|
} },
|
|
259
|
-
((
|
|
260
|
-
commonService.discountedCurrency(discountSeat.discountedPrice, currencySign))))) : (React.createElement("div", { className:
|
|
252
|
+
((_j = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _j === void 0 ? void 0 : _j.fireIcon) ? (React.createElement("img", { src: serviceItem.icons.fireIcon, alt: "discount", className: "h-[16px] w-[16px] object-contain", style: { opacity: isSoldOut ? 0.5 : 1 } })) : null,
|
|
253
|
+
commonService.discountedCurrency(discountSeat.discountedPrice, currencySign))))) : (React.createElement("div", { className: "flex flex-col justify-between h-[2.5rem] ", style: {
|
|
261
254
|
gap: isSoldOut ? "0px" : "5px",
|
|
262
255
|
justifyContent: hasMultipleTypes ? "space-between" : "center",
|
|
263
256
|
} },
|
|
@@ -3,7 +3,7 @@ declare const commonService: {
|
|
|
3
3
|
discountedCurrency(amount: number, currencySign?: string): string;
|
|
4
4
|
copyObject: (ob: any) => any;
|
|
5
5
|
getServiceTypeLabelForFilters: (service_type: any) => "Tipo de servicio" | "Punto de embarque" | "Tipo de asiento" | "SERVICIOS" | "";
|
|
6
|
-
truncateSeatLabel: (label: string | number
|
|
6
|
+
truncateSeatLabel: (label: string | number) => string;
|
|
7
7
|
getAmenitiesImage: (name: string, serviceItem: any) => string;
|
|
8
8
|
getAmenityName: (rawAmenity: string) => string;
|
|
9
9
|
getSeatNameForFilters: (rawSeat: any) => any;
|
|
@@ -34,15 +34,11 @@ const commonService = {
|
|
|
34
34
|
return "";
|
|
35
35
|
}
|
|
36
36
|
},
|
|
37
|
-
truncateSeatLabel: (label
|
|
37
|
+
truncateSeatLabel: (label) => {
|
|
38
38
|
if (typeof label !== "string")
|
|
39
39
|
return String(label);
|
|
40
40
|
if (label.includes("("))
|
|
41
41
|
return label;
|
|
42
|
-
// If maxLength provided, hard-truncate regardless of word count
|
|
43
|
-
if (maxLength != null && label.length > maxLength) {
|
|
44
|
-
return label.slice(0, maxLength) + "...";
|
|
45
|
-
}
|
|
46
42
|
const words = label.trim().split(/\s+/);
|
|
47
43
|
const truncateWord = (word) => word.length > 5 ? word.slice(0, 3) + "..." : word;
|
|
48
44
|
if (words.length === 1)
|
|
@@ -364,7 +360,7 @@ const commonService = {
|
|
|
364
360
|
let remaining = Math.max(0, Math.floor(countdownSeconds));
|
|
365
361
|
const formatTime = (totalSeconds) => {
|
|
366
362
|
if (totalSeconds <= 0)
|
|
367
|
-
return "
|
|
363
|
+
return "00:00";
|
|
368
364
|
const h = Math.floor(totalSeconds / 3600);
|
|
369
365
|
const m = Math.floor((totalSeconds % 3600) / 60);
|
|
370
366
|
const s = totalSeconds % 60;
|
package/package.json
CHANGED
|
@@ -131,13 +131,6 @@ function ServiceItemPB({
|
|
|
131
131
|
showLoginModal,
|
|
132
132
|
isLoggedIn,
|
|
133
133
|
showLoginOption,
|
|
134
|
-
isTrain,
|
|
135
|
-
selectedSeatKey,
|
|
136
|
-
onSeatSelect,
|
|
137
|
-
onTrainButtonClick,
|
|
138
|
-
showSeatSelectionError,
|
|
139
|
-
onShowSeatSelectionError,
|
|
140
|
-
onClearSeatSelectionError,
|
|
141
134
|
isFeatureDropDownExpand,
|
|
142
135
|
setIsFeatureDropDownExpand,
|
|
143
136
|
ticketQuantity,
|
|
@@ -152,15 +145,6 @@ function ServiceItemPB({
|
|
|
152
145
|
isFlores,
|
|
153
146
|
operatorLabel,
|
|
154
147
|
}: ServiceItemProps & { currencySign?: string }): React.ReactElement {
|
|
155
|
-
const handleSeatSelect = (
|
|
156
|
-
key: any,
|
|
157
|
-
price: number,
|
|
158
|
-
seatKey: string,
|
|
159
|
-
apiSeatType?: string,
|
|
160
|
-
) => {
|
|
161
|
-
onClearSeatSelectionError?.();
|
|
162
|
-
onSeatSelect?.(key, price, seatKey, apiSeatType);
|
|
163
|
-
};
|
|
164
148
|
const getAnimationIcon = (icon: string) => {
|
|
165
149
|
const animation = ANIMATION_MAP[icon];
|
|
166
150
|
if (!animation) return null;
|
|
@@ -382,17 +366,6 @@ function ServiceItemPB({
|
|
|
382
366
|
return;
|
|
383
367
|
}
|
|
384
368
|
|
|
385
|
-
if (isTrain) {
|
|
386
|
-
if (!selectedSeatKey) {
|
|
387
|
-
onShowSeatSelectionError?.(serviceItem.id);
|
|
388
|
-
return;
|
|
389
|
-
}
|
|
390
|
-
if (onTrainButtonClick) {
|
|
391
|
-
onTrainButtonClick();
|
|
392
|
-
return;
|
|
393
|
-
}
|
|
394
|
-
}
|
|
395
|
-
|
|
396
369
|
onBookButtonPress();
|
|
397
370
|
};
|
|
398
371
|
|
|
@@ -585,9 +558,7 @@ function ServiceItemPB({
|
|
|
585
558
|
: "",
|
|
586
559
|
}}
|
|
587
560
|
>
|
|
588
|
-
<div
|
|
589
|
-
className={`grid text-[#464647] w-full ${isTrain ? "[grid-template-columns:16%_30%_2.5%_28%_15.5%]" : "[grid-template-columns:20%_30%_2.5%_24%_15.5%]"} gap-x-[2%] items-center`}
|
|
590
|
-
>
|
|
561
|
+
<div className="grid text-[#464647] w-full [grid-template-columns:20%_30%_2.5%_24%_15.5%] gap-x-[2%] items-center">
|
|
591
562
|
{/* OPERATOR LOGO */}
|
|
592
563
|
<div className="flex flex-col gap-[5px]">
|
|
593
564
|
<div>
|
|
@@ -649,10 +620,6 @@ function ServiceItemPB({
|
|
|
649
620
|
isPeru={isPeru}
|
|
650
621
|
renderIcon={renderIcon}
|
|
651
622
|
discountSeatPriceColor={colors.discountSeatPriceColor}
|
|
652
|
-
isTrain={isTrain}
|
|
653
|
-
selectedSeatKey={selectedSeatKey}
|
|
654
|
-
onSeatSelect={handleSeatSelect}
|
|
655
|
-
topLabelColor={colors.topLabelColor}
|
|
656
623
|
tooltipColor={colors.tooltipColor}
|
|
657
624
|
/>
|
|
658
625
|
</div>
|
|
@@ -669,18 +636,6 @@ function ServiceItemPB({
|
|
|
669
636
|
soldOutIcon={renderIcon("soldOutIcon", "14px")}
|
|
670
637
|
onClick={checkMidnight}
|
|
671
638
|
/>
|
|
672
|
-
{showSeatSelectionError === serviceItem.id && isTrain && (
|
|
673
|
-
<div className="flex justify-center mr-[11px] w-[100%] right-[0px] absolute left-[0] top-[40px]">
|
|
674
|
-
<div
|
|
675
|
-
className="text-[9px] text-center whitespace-nowrap"
|
|
676
|
-
style={{
|
|
677
|
-
color: colors.seatPriceColor,
|
|
678
|
-
}}
|
|
679
|
-
>
|
|
680
|
-
Selecciona el tipo de servicio
|
|
681
|
-
</div>
|
|
682
|
-
</div>
|
|
683
|
-
)}
|
|
684
639
|
{showLastSeats ? (
|
|
685
640
|
<div className="flex justify-center mr-[11px] w-[100%] right-[0px] absolute left-[0] top-[40px]">
|
|
686
641
|
{serviceItem?.available_seats < 10 &&
|
|
@@ -713,7 +668,6 @@ function ServiceItemPB({
|
|
|
713
668
|
setIsExpand(isItemExpanded ? null : serviceItem.id)
|
|
714
669
|
}
|
|
715
670
|
isPeru={isPeru}
|
|
716
|
-
isTrain={isTrain}
|
|
717
671
|
/>
|
|
718
672
|
</div>
|
|
719
673
|
</div>
|
|
@@ -741,10 +695,10 @@ function ServiceItemPB({
|
|
|
741
695
|
? {
|
|
742
696
|
borderLeft: isSoldOut
|
|
743
697
|
? ""
|
|
744
|
-
: `3px solid ${colors.
|
|
698
|
+
: `3px solid ${colors.rightGradiantColor || "#ff8842"}`,
|
|
745
699
|
borderRight: isSoldOut
|
|
746
700
|
? ""
|
|
747
|
-
: `3px solid ${colors.
|
|
701
|
+
: `3px solid ${colors.leftGradiantColor || "#ff8842"}`,
|
|
748
702
|
borderRadius: "0 0 18px 18px",
|
|
749
703
|
boxSizing: "border-box",
|
|
750
704
|
}
|
|
@@ -46,8 +46,6 @@ function ServiceItemMobile({
|
|
|
46
46
|
removeDuplicateSeats,
|
|
47
47
|
isLinatal,
|
|
48
48
|
viewersConfig,
|
|
49
|
-
operatorLabel,
|
|
50
|
-
isTrain,
|
|
51
49
|
isFeatureDropDownExpand,
|
|
52
50
|
setIsFeatureDropDownExpand,
|
|
53
51
|
ticketQuantity,
|
|
@@ -63,6 +61,7 @@ function ServiceItemMobile({
|
|
|
63
61
|
onTimeDropdownToggle,
|
|
64
62
|
wowDealData,
|
|
65
63
|
isFlores,
|
|
64
|
+
operatorLabel
|
|
66
65
|
}: MobileServiceItemProps): React.ReactElement {
|
|
67
66
|
const isItemExpanded = serviceItem.id === isExpanded;
|
|
68
67
|
const isPetSeat = (Object.keys(serviceItem?.pet_seat_info) || []).length > 0;
|
|
@@ -135,36 +135,36 @@ export interface MobileServiceItemProps {
|
|
|
135
135
|
bombAnim?: string;
|
|
136
136
|
whiteBoardingIcon?: string;
|
|
137
137
|
downArrow?: string;
|
|
138
|
-
personIcon?: string
|
|
138
|
+
personIcon?: string
|
|
139
139
|
specialDeparture?: string;
|
|
140
140
|
fireIcon?: string;
|
|
141
141
|
directoIcon?: string;
|
|
142
|
-
whiteFireIcon?: string
|
|
143
|
-
femaleAnim?:
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
whiteDestination?: string
|
|
148
|
-
userIcon?: string
|
|
149
|
-
|
|
150
|
-
sheildIcon?: string
|
|
151
|
-
busIcon?: string
|
|
152
|
-
whiteDownArrow?: string
|
|
153
|
-
empressaIcon?: string
|
|
154
|
-
flexibleIcon?: string
|
|
155
|
-
listoIcon?: string
|
|
156
|
-
precioIcon?: string
|
|
157
|
-
confirmarIcon?: string
|
|
142
|
+
whiteFireIcon?: string
|
|
143
|
+
femaleAnim?:string
|
|
144
|
+
thunderAnim?: string
|
|
145
|
+
personsAnim?: string
|
|
146
|
+
whiteOrigin?: string,
|
|
147
|
+
whiteDestination?: string,
|
|
148
|
+
userIcon?: string,
|
|
149
|
+
|
|
150
|
+
sheildIcon?: string,
|
|
151
|
+
busIcon?: string,
|
|
152
|
+
whiteDownArrow?: string,
|
|
153
|
+
empressaIcon?: string,
|
|
154
|
+
flexibleIcon?: string,
|
|
155
|
+
listoIcon?: string,
|
|
156
|
+
precioIcon?: string,
|
|
157
|
+
confirmarIcon?: string
|
|
158
158
|
cancelTicketIcon?: string;
|
|
159
159
|
changeTicketIcon?: string;
|
|
160
160
|
petFriendlyIcon?: string;
|
|
161
|
-
womenSeatIcon?: string
|
|
161
|
+
womenSeatIcon?: string
|
|
162
162
|
[key: string]: string | Record<string, string | undefined> | undefined;
|
|
163
163
|
};
|
|
164
164
|
useLottieFor?: string[];
|
|
165
165
|
};
|
|
166
166
|
onBookButtonPress?: () => void;
|
|
167
|
-
onRemateUiButtonClick?: ()
|
|
167
|
+
onRemateUiButtonClick?: ()=> void;
|
|
168
168
|
terminals?: any[];
|
|
169
169
|
showDropdown?: boolean;
|
|
170
170
|
setShowDropdown?: (value: boolean) => void;
|
|
@@ -208,7 +208,7 @@ export interface MobileServiceItemProps {
|
|
|
208
208
|
seatPriceColor?: string;
|
|
209
209
|
rightGradiantColor?: string;
|
|
210
210
|
leftGradiantColor?: string;
|
|
211
|
-
discountSeatPriceColor?: string
|
|
211
|
+
discountSeatPriceColor?: string
|
|
212
212
|
};
|
|
213
213
|
isCiva?: boolean;
|
|
214
214
|
currencySign?: string;
|
|
@@ -221,28 +221,23 @@ export interface MobileServiceItemProps {
|
|
|
221
221
|
showLastSeats?: boolean;
|
|
222
222
|
removeDuplicateSeats?: boolean;
|
|
223
223
|
isLinatal?: boolean;
|
|
224
|
-
|
|
224
|
+
viewersConfig?: {
|
|
225
225
|
min: number;
|
|
226
226
|
max: number;
|
|
227
227
|
interval?: number; // ms, default 5000
|
|
228
228
|
label?: string; // e.g. "personas están viendo este viaje"
|
|
229
229
|
icon?: string; // optional icon URL
|
|
230
230
|
};
|
|
231
|
-
|
|
232
|
-
isFeatureDropDownExpand?: any;
|
|
231
|
+
isFeatureDropDownExpand?: any;
|
|
233
232
|
setIsFeatureDropDownExpand?: (value: any) => void;
|
|
234
233
|
ticketQuantity?: number;
|
|
235
|
-
onIncreaseTicketQuantity?: (
|
|
236
|
-
|
|
237
|
-
) => void;
|
|
238
|
-
onDecreaseTicketQuantity?: (
|
|
239
|
-
serviceItem: MobileServiceItemProps["serviceItem"],
|
|
240
|
-
) => void;
|
|
234
|
+
onIncreaseTicketQuantity?: (serviceItem: MobileServiceItemProps["serviceItem"]) => void;
|
|
235
|
+
onDecreaseTicketQuantity?: (serviceItem: MobileServiceItemProps["serviceItem"]) => void;
|
|
241
236
|
cityOrigin?: { value: number; label: string };
|
|
242
237
|
cityDestination?: { value: number; label: string };
|
|
243
|
-
|
|
238
|
+
isNewUi?: boolean
|
|
244
239
|
|
|
245
|
-
|
|
240
|
+
selectedTimeSlot?: string;
|
|
246
241
|
onTimeSlotChange?: (slot: string) => void;
|
|
247
242
|
isTimeDropdownOpen?: string | number | null;
|
|
248
243
|
onTimeDropdownToggle?: (id?: string | number | null) => void;
|
|
@@ -252,18 +252,6 @@ export interface ServiceItemProps {
|
|
|
252
252
|
showLoginModal?: any;
|
|
253
253
|
isLoggedIn?: any;
|
|
254
254
|
showLoginOption?: boolean;
|
|
255
|
-
isTrain?: boolean;
|
|
256
|
-
selectedSeatKey?: any;
|
|
257
|
-
onSeatSelect?: (
|
|
258
|
-
key: any,
|
|
259
|
-
price: number,
|
|
260
|
-
seatKey: string,
|
|
261
|
-
apiSeatType?: string,
|
|
262
|
-
) => void;
|
|
263
|
-
onTrainButtonClick?: any;
|
|
264
|
-
showSeatSelectionError?: string | null;
|
|
265
|
-
onShowSeatSelectionError?: (serviceId: string) => void;
|
|
266
|
-
onClearSeatSelectionError?: () => void;
|
|
267
255
|
selectedTimeSlot?: string;
|
|
268
256
|
onTimeSlotChange?: (slot: string) => void;
|
|
269
257
|
isTimeDropdownOpen?: string | number | null;
|
|
@@ -28,7 +28,6 @@ interface BottomAmenitiesProps {
|
|
|
28
28
|
downArrowIcon?: React.ReactNode;
|
|
29
29
|
onToggleExpand: () => void;
|
|
30
30
|
isPeru?: boolean;
|
|
31
|
-
isTrain?: boolean;
|
|
32
31
|
}
|
|
33
32
|
|
|
34
33
|
function BottomAmenities({
|
|
@@ -43,7 +42,6 @@ function BottomAmenities({
|
|
|
43
42
|
downArrowIcon,
|
|
44
43
|
onToggleExpand,
|
|
45
44
|
isPeru,
|
|
46
|
-
isTrain,
|
|
47
45
|
}: BottomAmenitiesProps): React.ReactElement {
|
|
48
46
|
const hasPetInfo =
|
|
49
47
|
serviceItem.pet_seat_info &&
|
|
@@ -61,9 +59,7 @@ function BottomAmenities({
|
|
|
61
59
|
className="grid items-center gap-[2%] flex-1 "
|
|
62
60
|
style={{
|
|
63
61
|
// gridTemplateColumns: " 28% 21% 23% 23%",
|
|
64
|
-
gridTemplateColumns:
|
|
65
|
-
? "20.6% 17% 23% 23%"
|
|
66
|
-
: "25.3% 17% 23% 23%",
|
|
62
|
+
gridTemplateColumns: "25.3% 17% 23% 23%",
|
|
67
63
|
}}
|
|
68
64
|
>
|
|
69
65
|
{otherItems.map((item) => (
|
|
@@ -119,7 +119,7 @@ function DateTimeSection({
|
|
|
119
119
|
metaData={metaData}
|
|
120
120
|
colors={colors}
|
|
121
121
|
>
|
|
122
|
-
<span className="cursor-pointer bold-text capitalize
|
|
122
|
+
<span className="cursor-pointer bold-text capitalize">
|
|
123
123
|
{DateService.getServiceItemDate(serviceItem.travel_date)}
|
|
124
124
|
</span>
|
|
125
125
|
</StageTooltip>
|
|
@@ -134,7 +134,7 @@ function DateTimeSection({
|
|
|
134
134
|
metaData={metaData}
|
|
135
135
|
colors={colors}
|
|
136
136
|
>
|
|
137
|
-
<span className="cursor-pointer bold-text capitalize
|
|
137
|
+
<span className="cursor-pointer bold-text capitalize">
|
|
138
138
|
{DateService.getServiceItemDate(serviceItem.arrival_date)}
|
|
139
139
|
</span>
|
|
140
140
|
</StageTooltip>
|
|
@@ -169,7 +169,7 @@ function DateTimeSection({
|
|
|
169
169
|
metaData={metaData}
|
|
170
170
|
colors={colors}
|
|
171
171
|
>
|
|
172
|
-
<div className="font-[900] bold-text
|
|
172
|
+
<div className="font-[900] bold-text">
|
|
173
173
|
{isLinatal ? (
|
|
174
174
|
<>
|
|
175
175
|
{cleanedDepTime} <span>{hasPM ? "PM" : hasAM ? "AM" : ""}</span>
|
|
@@ -193,7 +193,7 @@ function DateTimeSection({
|
|
|
193
193
|
metaData={metaData}
|
|
194
194
|
colors={colors}
|
|
195
195
|
>
|
|
196
|
-
<div className="font-[900] bold-text
|
|
196
|
+
<div className="font-[900] bold-text">
|
|
197
197
|
{removeArrivalTime
|
|
198
198
|
? "\u00A0"
|
|
199
199
|
: serviceItem.arr_time
|
|
@@ -423,7 +423,7 @@ const FeatureServiceUi = ({
|
|
|
423
423
|
</div>
|
|
424
424
|
|
|
425
425
|
{/* MIDDLE: competing operators + viewers */}
|
|
426
|
-
<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]">
|
|
426
|
+
<div className="min-w-0 overflow-x-auto px-[22px] flex flex-col items-center justify-between gap-[16px] py-[2px] border-r border-[#363c48] border-l border-[#363c48]">
|
|
427
427
|
<div className="text-center">
|
|
428
428
|
<div className="bold-text text-[13px]">
|
|
429
429
|
{servicesInActiveSlot.length > 0
|
|
@@ -434,12 +434,12 @@ const FeatureServiceUi = ({
|
|
|
434
434
|
</div>
|
|
435
435
|
|
|
436
436
|
<div
|
|
437
|
-
className="grid
|
|
437
|
+
className="grid items-stretch gap-[14px]"
|
|
438
438
|
style={{
|
|
439
439
|
gridTemplateColumns: `repeat(${Math.min(
|
|
440
440
|
servicesInActiveSlot.length || operators.length,
|
|
441
441
|
3,
|
|
442
|
-
)}, 1fr)`,
|
|
442
|
+
)}, minmax(80px, 1fr))`,
|
|
443
443
|
}}
|
|
444
444
|
>
|
|
445
445
|
{(servicesInActiveSlot.length > 0
|
|
@@ -470,11 +470,14 @@ const FeatureServiceUi = ({
|
|
|
470
470
|
serviceItem?.operator_details?.[0] ||
|
|
471
471
|
"/images/service-list/bus-icon.svg";
|
|
472
472
|
}}
|
|
473
|
-
className={`h-[24px] max-w-full object-contain
|
|
473
|
+
className={`h-[24px] max-w-full object-contain ${
|
|
474
474
|
isSoldOut ? "grayscale" : ""
|
|
475
475
|
}`}
|
|
476
|
+
// className={`h-[24px] max-w-full object-contain brightness-0 invert ${
|
|
477
|
+
// isSoldOut ? "grayscale" : ""
|
|
478
|
+
// }`}
|
|
476
479
|
/>
|
|
477
|
-
<span className="text-[11px] truncate
|
|
480
|
+
<span className="text-[11px] truncate w-full text-center text-[white] overflow-hidden">
|
|
478
481
|
{op.name}
|
|
479
482
|
</span>
|
|
480
483
|
<div className="bg-[#FF8F45] text-white text-[12px] font-bold px-[10px] py-[4px] rounded-[4px] bold-text whitespace-nowrap">
|