kupos-ui-components-lib 9.1.10 → 9.2.1
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/FilterBar/FilterBarDesktop.js +28 -27
- package/dist/components/ServiceItem/ServiceItemDesktop.js +6 -2
- package/dist/components/ServiceItem/ServiceItemMobile.js +2 -2
- package/dist/ui/ExpendedDropDown/ExpandedDropdown.d.ts +4 -1
- package/dist/ui/ExpendedDropDown/ExpandedDropdown.js +8 -3
- package/dist/ui/mobileweb/ExpandedDropdownMobile.d.ts +5 -1
- package/dist/ui/mobileweb/ExpandedDropdownMobile.js +15 -3
- package/package.json +1 -1
- package/src/components/FilterBar/FilterBarDesktop.tsx +35 -28
- package/src/components/ServiceItem/ServiceItemDesktop.tsx +10 -1
- package/src/components/ServiceItem/ServiceItemMobile.tsx +8 -2
- package/src/ui/ExpendedDropDown/ExpandedDropdown.tsx +32 -12
- package/src/ui/mobileweb/ExpandedDropdownMobile.tsx +50 -12
|
@@ -1,42 +1,43 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import commonService from "../../utils/CommonService";
|
|
3
3
|
import ServiceFilter from "./ServiceFilter";
|
|
4
|
+
let cachedStageOptions = null;
|
|
4
5
|
const FilterBarDesktop = ({ t, serviceList, setServiceList, allSchedules, showReturnTripModal, filterArrData, isBlankTicket, operatorId, filtersArray, setFiltersArray, metaData, busTerminals, setTypes, colors, icons, translation, isTrain, isPeru, hideOperator, setCoachLoading, setCoachKey, isAllinBus, }) => {
|
|
5
6
|
const getEnrichedFilters = () => {
|
|
6
|
-
if (!isAllinBus || !(allSchedules === null || allSchedules === void 0 ? void 0 : allSchedules.length))
|
|
7
|
-
return filtersArray;
|
|
8
7
|
const hasSpecialDeparture = filtersArray.some((f) => { var _a; return f.type === "special_departure" && ((_a = f.options) === null || _a === void 0 ? void 0 : _a.length) > 0; });
|
|
9
8
|
if (hasSpecialDeparture)
|
|
10
9
|
return filtersArray;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
10
|
+
if (isAllinBus && (allSchedules === null || allSchedules === void 0 ? void 0 : allSchedules.length)) {
|
|
11
|
+
const stageMap = new Map();
|
|
12
|
+
allSchedules.forEach((schedule) => {
|
|
13
|
+
var _a, _b, _c;
|
|
14
|
+
if ((_a = schedule.stage_details_arr) === null || _a === void 0 ? void 0 : _a.length) {
|
|
15
|
+
const stageObj = schedule.stage_details_arr[0];
|
|
16
|
+
const stageId = Object.keys(stageObj)[0];
|
|
17
|
+
const stageName = (_c = (_b = stageObj[stageId]) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.split(", ")[0];
|
|
18
|
+
if (stageId && stageName) {
|
|
19
|
+
stageMap.set(stageId, stageName);
|
|
20
|
+
}
|
|
20
21
|
}
|
|
22
|
+
});
|
|
23
|
+
if (stageMap.size > 0) {
|
|
24
|
+
cachedStageOptions = Array.from(stageMap.entries()).map(([id, name]) => ({
|
|
25
|
+
label: name,
|
|
26
|
+
value: id,
|
|
27
|
+
active: false,
|
|
28
|
+
}));
|
|
21
29
|
}
|
|
22
|
-
}
|
|
23
|
-
if (
|
|
24
|
-
return filtersArray
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
active: false,
|
|
29
|
-
}));
|
|
30
|
-
return [
|
|
31
|
-
...filtersArray,
|
|
32
|
-
{
|
|
33
|
-
type: "special_departure",
|
|
34
|
-
title: "SPECIAL_DEPARTURE",
|
|
35
|
-
options: specialDeptOptions,
|
|
36
|
-
},
|
|
37
|
-
];
|
|
30
|
+
}
|
|
31
|
+
if (cachedStageOptions === null || cachedStageOptions === void 0 ? void 0 : cachedStageOptions.length) {
|
|
32
|
+
return filtersArray.map((f) => f.type === "special_departure"
|
|
33
|
+
? Object.assign(Object.assign({}, f), { options: cachedStageOptions }) : f);
|
|
34
|
+
}
|
|
35
|
+
return filtersArray;
|
|
38
36
|
};
|
|
39
37
|
const enrichedFilters = getEnrichedFilters();
|
|
38
|
+
if (enrichedFilters !== filtersArray) {
|
|
39
|
+
setFiltersArray(enrichedFilters);
|
|
40
|
+
}
|
|
40
41
|
const filterBy = (filters) => {
|
|
41
42
|
try {
|
|
42
43
|
let routes = allSchedules;
|
|
@@ -283,7 +283,11 @@ function ServiceItemPB({ serviceItem, onBookButtonPress, colors, metaData, child
|
|
|
283
283
|
} },
|
|
284
284
|
React.createElement("div", {
|
|
285
285
|
// className="grid text-[#464647] w-full [grid-template-columns:18%_28%_2.5%_28%_15.5%] gap-x-[2%] items-center"
|
|
286
|
-
className: "grid text-[#464647] w-full [grid-template-columns:22%_28%_2.5%_24%_15.5%] gap-x-[2%] items-center"
|
|
286
|
+
className: "grid text-[#464647] w-full [grid-template-columns:22%_28%_2.5%_24%_15.5%] gap-x-[2%] items-center",
|
|
287
|
+
// style={{ marginTop: showTopLabel ? "8px" : "" }}
|
|
288
|
+
style: {
|
|
289
|
+
marginTop: showTopLabel && (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_direct_trip) ? "8px" : "",
|
|
290
|
+
} },
|
|
287
291
|
React.createElement("div", { style: {
|
|
288
292
|
display: "flex",
|
|
289
293
|
flexDirection: "column",
|
|
@@ -322,7 +326,7 @@ function ServiceItemPB({ serviceItem, onBookButtonPress, colors, metaData, child
|
|
|
322
326
|
zIndex: -1,
|
|
323
327
|
} },
|
|
324
328
|
React.createElement("div", { style: { overflow: "hidden", minHeight: 0, marginTop: "-10px" } },
|
|
325
|
-
React.createElement(ExpandedDropdown, { serviceItem: serviceItem }))),
|
|
329
|
+
React.createElement(ExpandedDropdown, { serviceItem: serviceItem, isPeru: isPeru, translation: translation, getAnimationIcon: getAnimationIcon }))),
|
|
326
330
|
children,
|
|
327
331
|
(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.offer_text) && (React.createElement("div", { className: "text-white p-[10px_15px] text-left w-full flex items-center absolute -bottom-[36px] pt-[50px] -z-10 rounded-b-[14px] text-[14px]", style: {
|
|
328
332
|
backgroundColor: colors === null || colors === void 0 ? void 0 : colors.bottomStripColor,
|
|
@@ -138,7 +138,7 @@ function ServiceItemMobile({ serviceItem, onBookButtonPress, colors, busStage, o
|
|
|
138
138
|
React.createElement("img", { src: serviceItem.icons.rating, alt: "origin", className: `w-[12px] h-[12px] mr-[4px] object-contain ${isSoldOut ? "grayscale" : ""}` }),
|
|
139
139
|
React.createElement("span", { style: { lineHeight: "normal" } }, getServiceStars(serviceItem))),
|
|
140
140
|
React.createElement("div", { className: "flex items-center cursor-pointer ", style: { color: isSoldOut ? "#bbb" : "text-[#464647]" } },
|
|
141
|
-
React.createElement("span", { className: "ml-[3px] min-[420]:text-[13px] text-[12px] text-ellipsis" }, serviceItem.operator_details[2]))))) : null),
|
|
141
|
+
React.createElement("span", { className: "ml-[3px] min-[420]:text-[13px] text-[12px] text-ellipsis overflow-hidden whitespace-nowrap max-w-[120px]" }, serviceItem.operator_details[2]))))) : null),
|
|
142
142
|
showLastSeats ? (React.createElement("div", { className: "flex justify-end " }, (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.available_seats) < 10 &&
|
|
143
143
|
(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),
|
|
144
144
|
React.createElement(DateTimeSectionMobile, { onBookButtonPress: onBookButtonPress, isCiva: isCiva, isSoldOut: isSoldOut, isLinatal: isLinatal, isPeru: isPeru, orignLabel: orignLabel, destinationLabel: destinationLabel, originIcon: (_b = serviceItem.icons) === null || _b === void 0 ? void 0 : _b.origin, destinationIcon: (_c = serviceItem.icons) === null || _c === void 0 ? void 0 : _c.destination, travelDate: serviceItem.travel_date, arrivalDate: serviceItem.arrival_date, depTime: serviceItem.dep_time, arrTime: serviceItem.arr_time, seatTypes: serviceItem.seat_types, seatPriceColor: colors.seatPriceColor, currencySign: currencySign, availableSeats: serviceItem.available_seats, removeDuplicateSeats: removeDuplicateSeats, serviceItem: serviceItem }),
|
|
@@ -229,6 +229,6 @@ function ServiceItemMobile({ serviceItem, onBookButtonPress, colors, busStage, o
|
|
|
229
229
|
zIndex: (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.offer_text) ? -3 : undefined,
|
|
230
230
|
marginTop: (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.offer_text) ? "-15px" : "-10px",
|
|
231
231
|
} },
|
|
232
|
-
React.createElement(ExpandedDropdownMobile, { serviceItem: serviceItem })))));
|
|
232
|
+
React.createElement(ExpandedDropdownMobile, { serviceItem: serviceItem, isPeru: isPeru, petSeatInfo: serviceItem.pet_seat_info, petFriendlyAnim: serviceItem.icons.petFriendlyAnim, isSoldOut: isSoldOut })))));
|
|
233
233
|
}
|
|
234
234
|
export default ServiceItemMobile;
|
|
@@ -6,6 +6,9 @@ interface ExpandedDropdownProps {
|
|
|
6
6
|
is_change_ticket?: boolean;
|
|
7
7
|
is_tracking_enabled?: boolean;
|
|
8
8
|
};
|
|
9
|
+
isPeru?: boolean;
|
|
10
|
+
translation?: Record<string, string>;
|
|
11
|
+
getAnimationIcon?: (iconName: string) => any;
|
|
9
12
|
}
|
|
10
|
-
declare function ExpandedDropdown({ serviceItem, }: ExpandedDropdownProps): React.ReactElement;
|
|
13
|
+
declare function ExpandedDropdown({ serviceItem, isPeru, translation, getAnimationIcon, }: ExpandedDropdownProps): React.ReactElement;
|
|
11
14
|
export default ExpandedDropdown;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
|
|
2
|
+
import LottiePlayer from "../../assets/LottiePlayer";
|
|
3
|
+
function ExpandedDropdown({ serviceItem, isPeru = false, translation = {}, getAnimationIcon, }) {
|
|
3
4
|
const hasPetInfo = serviceItem.pet_seat_info &&
|
|
4
5
|
Object.keys(serviceItem.pet_seat_info).length > 0;
|
|
5
6
|
return (React.createElement("div", { className: "px-[15px] pt-[26px] pb-[14px] -mt-[16px] pt-[35px] relative -z-9", style: {
|
|
@@ -10,6 +11,10 @@ function ExpandedDropdown({ serviceItem, }) {
|
|
|
10
11
|
// borderTop: "none",
|
|
11
12
|
} },
|
|
12
13
|
React.createElement("div", { className: "flex flex-col gap-[10px] text-[13px] text-[#464647]", style: { lineHeight: 1.6 } },
|
|
14
|
+
hasPetInfo && (React.createElement("div", { className: "flex items-center gap-[10px]" },
|
|
15
|
+
React.createElement(LottiePlayer, { animationData: getAnimationIcon("petFriendlyAnim"), width: "20px", height: "20px" }),
|
|
16
|
+
React.createElement("div", { className: "h-auto mr-[4px] text-[13px] text-[#464647] bold-text" },
|
|
17
|
+
React.createElement("span", null, translation === null || translation === void 0 ? void 0 : translation.petFriendly)))),
|
|
13
18
|
React.createElement("div", { className: "flex gap-[8px] text-[13.33px]" },
|
|
14
19
|
React.createElement("span", { style: { marginTop: "2px" } }, "\u2022"),
|
|
15
20
|
React.createElement("span", null,
|
|
@@ -22,7 +27,7 @@ function ExpandedDropdown({ serviceItem, }) {
|
|
|
22
27
|
" horas antes"),
|
|
23
28
|
" ",
|
|
24
29
|
"de la salida del bus. Al anular tu pasaje recibir\u00E1s una devoluci\u00F3n del 85% del monto de tu compra.")),
|
|
25
|
-
React.createElement("div", { className: "flex gap-[8px]" },
|
|
30
|
+
isPeru ? null : (React.createElement("div", { className: "flex gap-[8px]" },
|
|
26
31
|
React.createElement("span", { style: { marginTop: "2px" } }, "\u2022"),
|
|
27
32
|
React.createElement("span", null,
|
|
28
33
|
React.createElement("span", { className: "bold-text" }, "Pol\u00EDticas de cambios:"),
|
|
@@ -33,6 +38,6 @@ function ExpandedDropdown({ serviceItem, }) {
|
|
|
33
38
|
(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.change_ticket_hours) || 6,
|
|
34
39
|
" horas antes"),
|
|
35
40
|
" ",
|
|
36
|
-
"de la salida del bus. El monto ser\u00E1 reembolsado a tu billetera kupospay.")))));
|
|
41
|
+
"de la salida del bus. El monto ser\u00E1 reembolsado a tu billetera kupospay."))))));
|
|
37
42
|
}
|
|
38
43
|
export default ExpandedDropdown;
|
|
@@ -6,6 +6,10 @@ interface ExpandedDropdownMobileProps {
|
|
|
6
6
|
is_change_ticket?: boolean;
|
|
7
7
|
is_tracking_enabled?: boolean;
|
|
8
8
|
};
|
|
9
|
+
isPeru?: boolean;
|
|
10
|
+
petSeatInfo?: Record<string, any>;
|
|
11
|
+
petFriendlyAnim?: any;
|
|
12
|
+
isSoldOut?: boolean;
|
|
9
13
|
}
|
|
10
|
-
declare function ExpandedDropdownMobile({ serviceItem, }: ExpandedDropdownMobileProps): React.ReactElement;
|
|
14
|
+
declare function ExpandedDropdownMobile({ serviceItem, isPeru, petSeatInfo, petFriendlyAnim, isSoldOut, }: ExpandedDropdownMobileProps): React.ReactElement;
|
|
11
15
|
export default ExpandedDropdownMobile;
|
|
@@ -1,10 +1,22 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
|
|
2
|
+
import LottiePlayer from "../../assets/LottiePlayer";
|
|
3
|
+
function ExpandedDropdownMobile({ serviceItem, isPeru, petSeatInfo, petFriendlyAnim, isSoldOut, }) {
|
|
3
4
|
return (React.createElement("div", { className: "px-[12px] pt-[22px] pb-[12px] relative -z-9", style: {
|
|
4
5
|
backgroundColor: "#ffefef",
|
|
5
6
|
borderRadius: "0 0 14px 14px",
|
|
6
7
|
} },
|
|
7
8
|
React.createElement("div", { className: "flex flex-col gap-[8px] text-[11px] min-[420px]:text-[12px] text-[#464647]", style: { lineHeight: 1.6 } },
|
|
9
|
+
petSeatInfo && Object.keys(petSeatInfo).length > 0 ? (React.createElement("div", { className: "flex items-center" },
|
|
10
|
+
React.createElement("div", { className: `relative group cursor-default ` },
|
|
11
|
+
React.createElement("div", { className: "flex items-center" },
|
|
12
|
+
React.createElement("div", { className: `flex items-justify gap-[6px] mr-[5px] ${isSoldOut ? "grayscale" : ""}` },
|
|
13
|
+
React.createElement("div", null,
|
|
14
|
+
React.createElement(LottiePlayer, { animationData: petFriendlyAnim, width: "16px", height: "16px" })),
|
|
15
|
+
React.createElement("div", null,
|
|
16
|
+
React.createElement("span", null, "Servicio Pet friendly"),
|
|
17
|
+
React.createElement("span", null,
|
|
18
|
+
" ",
|
|
19
|
+
"Asientos designados Pet friendly, lo que significa que puede viajar con su mascota a bordo."))))))) : null,
|
|
8
20
|
React.createElement("div", { className: "flex gap-[6px]" },
|
|
9
21
|
React.createElement("span", { style: { marginTop: "2px" } }, "\u2022"),
|
|
10
22
|
React.createElement("span", null,
|
|
@@ -17,7 +29,7 @@ function ExpandedDropdownMobile({ serviceItem, }) {
|
|
|
17
29
|
" horas antes"),
|
|
18
30
|
" ",
|
|
19
31
|
"de la salida del bus. Al anular tu pasaje recibir\u00E1s una devoluci\u00F3n del 85% del monto de tu compra.")),
|
|
20
|
-
React.createElement("div", { className: "flex gap-[6px]" },
|
|
32
|
+
isPeru ? null : (React.createElement("div", { className: "flex gap-[6px]" },
|
|
21
33
|
React.createElement("span", { style: { marginTop: "2px" } }, "\u2022"),
|
|
22
34
|
React.createElement("span", null,
|
|
23
35
|
React.createElement("span", { className: "bold-text" }, "Pol\u00EDticas de cambios:"),
|
|
@@ -28,6 +40,6 @@ function ExpandedDropdownMobile({ serviceItem, }) {
|
|
|
28
40
|
(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.change_ticket_hours) || 6,
|
|
29
41
|
" horas antes"),
|
|
30
42
|
" ",
|
|
31
|
-
"de la salida del bus. El monto ser\u00E1 reembolsado a tu billetera kupospay.")))));
|
|
43
|
+
"de la salida del bus. El monto ser\u00E1 reembolsado a tu billetera kupospay."))))));
|
|
32
44
|
}
|
|
33
45
|
export default ExpandedDropdownMobile;
|
package/package.json
CHANGED
|
@@ -3,6 +3,8 @@ import { FilterBarProps } from "./tyoes";
|
|
|
3
3
|
import commonService from "../../utils/CommonService";
|
|
4
4
|
import ServiceFilter from "./ServiceFilter";
|
|
5
5
|
|
|
6
|
+
let cachedStageOptions: any[] | null = null;
|
|
7
|
+
|
|
6
8
|
const FilterBarDesktop = ({
|
|
7
9
|
t,
|
|
8
10
|
serviceList,
|
|
@@ -28,47 +30,52 @@ const FilterBarDesktop = ({
|
|
|
28
30
|
isAllinBus,
|
|
29
31
|
}: FilterBarProps) => {
|
|
30
32
|
const getEnrichedFilters = () => {
|
|
31
|
-
if (!isAllinBus || !allSchedules?.length) return filtersArray;
|
|
32
|
-
|
|
33
33
|
const hasSpecialDeparture = filtersArray.some(
|
|
34
34
|
(f: any) => f.type === "special_departure" && f.options?.length > 0,
|
|
35
35
|
);
|
|
36
36
|
if (hasSpecialDeparture) return filtersArray;
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
38
|
+
if (isAllinBus && allSchedules?.length) {
|
|
39
|
+
const stageMap = new Map<string, string>();
|
|
40
|
+
allSchedules.forEach((schedule: any) => {
|
|
41
|
+
if (schedule.stage_details_arr?.length) {
|
|
42
|
+
const stageObj = schedule.stage_details_arr[0];
|
|
43
|
+
const stageId = Object.keys(stageObj)[0];
|
|
44
|
+
const stageName = stageObj[stageId]?.[0]?.split(", ")[0];
|
|
45
|
+
if (stageId && stageName) {
|
|
46
|
+
stageMap.set(stageId, stageName);
|
|
47
|
+
}
|
|
46
48
|
}
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
+
});
|
|
49
50
|
|
|
50
|
-
|
|
51
|
+
if (stageMap.size > 0) {
|
|
52
|
+
cachedStageOptions = Array.from(stageMap.entries()).map(
|
|
53
|
+
([id, name]) => ({
|
|
54
|
+
label: name,
|
|
55
|
+
value: id,
|
|
56
|
+
active: false,
|
|
57
|
+
}),
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
51
61
|
|
|
52
|
-
|
|
53
|
-
(
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
62
|
+
if (cachedStageOptions?.length) {
|
|
63
|
+
return filtersArray.map((f: any) =>
|
|
64
|
+
f.type === "special_departure"
|
|
65
|
+
? { ...f, options: cachedStageOptions! }
|
|
66
|
+
: f,
|
|
67
|
+
);
|
|
68
|
+
}
|
|
59
69
|
|
|
60
|
-
return
|
|
61
|
-
...filtersArray,
|
|
62
|
-
{
|
|
63
|
-
type: "special_departure",
|
|
64
|
-
title: "SPECIAL_DEPARTURE",
|
|
65
|
-
options: specialDeptOptions,
|
|
66
|
-
},
|
|
67
|
-
];
|
|
70
|
+
return filtersArray;
|
|
68
71
|
};
|
|
69
72
|
|
|
70
73
|
const enrichedFilters = getEnrichedFilters();
|
|
71
74
|
|
|
75
|
+
if (enrichedFilters !== filtersArray) {
|
|
76
|
+
setFiltersArray(enrichedFilters);
|
|
77
|
+
}
|
|
78
|
+
|
|
72
79
|
const filterBy = (filters) => {
|
|
73
80
|
try {
|
|
74
81
|
let routes = allSchedules;
|
|
@@ -496,6 +496,10 @@ function ServiceItemPB({
|
|
|
496
496
|
// className="grid text-[#464647] w-full [grid-template-columns:18%_28%_2.5%_28%_15.5%] gap-x-[2%] items-center"
|
|
497
497
|
className="grid text-[#464647] w-full [grid-template-columns:22%_28%_2.5%_24%_15.5%] gap-x-[2%] items-center"
|
|
498
498
|
// style={{ marginTop: showTopLabel ? "8px" : "" }}
|
|
499
|
+
style={{
|
|
500
|
+
marginTop:
|
|
501
|
+
showTopLabel && serviceItem?.is_direct_trip ? "8px" : "",
|
|
502
|
+
}}
|
|
499
503
|
>
|
|
500
504
|
{/* OPERATOR LOGO */}
|
|
501
505
|
<div
|
|
@@ -631,7 +635,12 @@ function ServiceItemPB({
|
|
|
631
635
|
<div
|
|
632
636
|
style={{ overflow: "hidden", minHeight: 0, marginTop: "-10px" }}
|
|
633
637
|
>
|
|
634
|
-
<ExpandedDropdown
|
|
638
|
+
<ExpandedDropdown
|
|
639
|
+
serviceItem={serviceItem}
|
|
640
|
+
isPeru={isPeru}
|
|
641
|
+
translation={translation}
|
|
642
|
+
getAnimationIcon={getAnimationIcon}
|
|
643
|
+
/>
|
|
635
644
|
</div>
|
|
636
645
|
</div>
|
|
637
646
|
|
|
@@ -253,7 +253,7 @@ function ServiceItemMobile({
|
|
|
253
253
|
className="flex items-center cursor-pointer "
|
|
254
254
|
style={{ color: isSoldOut ? "#bbb" : "text-[#464647]" }}
|
|
255
255
|
>
|
|
256
|
-
<span className="ml-[3px] min-[420]:text-[13px] text-[12px] text-ellipsis">
|
|
256
|
+
<span className="ml-[3px] min-[420]:text-[13px] text-[12px] text-ellipsis overflow-hidden whitespace-nowrap max-w-[120px]">
|
|
257
257
|
{serviceItem.operator_details[2]}
|
|
258
258
|
</span>
|
|
259
259
|
</div>
|
|
@@ -497,7 +497,13 @@ function ServiceItemMobile({
|
|
|
497
497
|
marginTop: serviceItem?.offer_text ? "-15px" : "-10px",
|
|
498
498
|
}}
|
|
499
499
|
>
|
|
500
|
-
<ExpandedDropdownMobile
|
|
500
|
+
<ExpandedDropdownMobile
|
|
501
|
+
serviceItem={serviceItem}
|
|
502
|
+
isPeru={isPeru}
|
|
503
|
+
petSeatInfo={serviceItem.pet_seat_info}
|
|
504
|
+
petFriendlyAnim={serviceItem.icons.petFriendlyAnim}
|
|
505
|
+
isSoldOut={isSoldOut}
|
|
506
|
+
/>
|
|
501
507
|
</div>
|
|
502
508
|
</div>
|
|
503
509
|
</div>
|
|
@@ -8,10 +8,16 @@ interface ExpandedDropdownProps {
|
|
|
8
8
|
is_change_ticket?: boolean;
|
|
9
9
|
is_tracking_enabled?: boolean;
|
|
10
10
|
};
|
|
11
|
+
isPeru?: boolean;
|
|
12
|
+
translation?: Record<string, string>;
|
|
13
|
+
getAnimationIcon?: (iconName: string) => any;
|
|
11
14
|
}
|
|
12
15
|
|
|
13
16
|
function ExpandedDropdown({
|
|
14
17
|
serviceItem,
|
|
18
|
+
isPeru = false,
|
|
19
|
+
translation = {},
|
|
20
|
+
getAnimationIcon,
|
|
15
21
|
}: ExpandedDropdownProps): React.ReactElement {
|
|
16
22
|
const hasPetInfo =
|
|
17
23
|
serviceItem.pet_seat_info &&
|
|
@@ -71,6 +77,18 @@ function ExpandedDropdown({
|
|
|
71
77
|
className="flex flex-col gap-[10px] text-[13px] text-[#464647]"
|
|
72
78
|
style={{ lineHeight: 1.6 }}
|
|
73
79
|
>
|
|
80
|
+
{hasPetInfo && (
|
|
81
|
+
<div className="flex items-center gap-[10px]">
|
|
82
|
+
<LottiePlayer
|
|
83
|
+
animationData={getAnimationIcon("petFriendlyAnim")}
|
|
84
|
+
width="20px"
|
|
85
|
+
height="20px"
|
|
86
|
+
/>
|
|
87
|
+
<div className="h-auto mr-[4px] text-[13px] text-[#464647] bold-text">
|
|
88
|
+
<span>{translation?.petFriendly}</span>
|
|
89
|
+
</div>
|
|
90
|
+
</div>
|
|
91
|
+
)}
|
|
74
92
|
<div className="flex gap-[8px] text-[13.33px]">
|
|
75
93
|
<span style={{ marginTop: "2px" }}>•</span>
|
|
76
94
|
<span>
|
|
@@ -83,18 +101,20 @@ function ExpandedDropdown({
|
|
|
83
101
|
del 85% del monto de tu compra.
|
|
84
102
|
</span>
|
|
85
103
|
</div>
|
|
86
|
-
|
|
87
|
-
<
|
|
88
|
-
|
|
89
|
-
<span
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
104
|
+
{isPeru ? null : (
|
|
105
|
+
<div className="flex gap-[8px]">
|
|
106
|
+
<span style={{ marginTop: "2px" }}>•</span>
|
|
107
|
+
<span>
|
|
108
|
+
<span className="bold-text">Políticas de cambios:</span> Tu pasaje
|
|
109
|
+
puede ser cambiado de manera online{" "}
|
|
110
|
+
<span className="bold-text">
|
|
111
|
+
hasta {serviceItem?.change_ticket_hours || 6} horas antes
|
|
112
|
+
</span>{" "}
|
|
113
|
+
de la salida del bus. El monto será reembolsado a tu billetera
|
|
114
|
+
kupospay.
|
|
115
|
+
</span>
|
|
116
|
+
</div>
|
|
117
|
+
)}
|
|
98
118
|
</div>
|
|
99
119
|
</div>
|
|
100
120
|
);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import LottiePlayer from "../../assets/LottiePlayer";
|
|
2
3
|
|
|
3
4
|
interface ExpandedDropdownMobileProps {
|
|
4
5
|
serviceItem: {
|
|
@@ -7,10 +8,18 @@ interface ExpandedDropdownMobileProps {
|
|
|
7
8
|
is_change_ticket?: boolean;
|
|
8
9
|
is_tracking_enabled?: boolean;
|
|
9
10
|
};
|
|
11
|
+
isPeru?: boolean;
|
|
12
|
+
petSeatInfo?: Record<string, any>;
|
|
13
|
+
petFriendlyAnim?: any;
|
|
14
|
+
isSoldOut?: boolean;
|
|
10
15
|
}
|
|
11
16
|
|
|
12
17
|
function ExpandedDropdownMobile({
|
|
13
18
|
serviceItem,
|
|
19
|
+
isPeru,
|
|
20
|
+
petSeatInfo,
|
|
21
|
+
petFriendlyAnim,
|
|
22
|
+
isSoldOut,
|
|
14
23
|
}: ExpandedDropdownMobileProps): React.ReactElement {
|
|
15
24
|
return (
|
|
16
25
|
<div
|
|
@@ -24,6 +33,33 @@ function ExpandedDropdownMobile({
|
|
|
24
33
|
className="flex flex-col gap-[8px] text-[11px] min-[420px]:text-[12px] text-[#464647]"
|
|
25
34
|
style={{ lineHeight: 1.6 }}
|
|
26
35
|
>
|
|
36
|
+
{petSeatInfo && Object.keys(petSeatInfo).length > 0 ? (
|
|
37
|
+
<div className="flex items-center">
|
|
38
|
+
<div className={`relative group cursor-default `}>
|
|
39
|
+
<div className="flex items-center">
|
|
40
|
+
<div
|
|
41
|
+
className={`flex items-justify gap-[6px] mr-[5px] ${isSoldOut ? "grayscale" : ""}`}
|
|
42
|
+
>
|
|
43
|
+
<div>
|
|
44
|
+
<LottiePlayer
|
|
45
|
+
animationData={petFriendlyAnim}
|
|
46
|
+
width="16px"
|
|
47
|
+
height="16px"
|
|
48
|
+
/>
|
|
49
|
+
</div>
|
|
50
|
+
<div>
|
|
51
|
+
<span>Servicio Pet friendly</span>
|
|
52
|
+
<span>
|
|
53
|
+
{" "}
|
|
54
|
+
Asientos designados Pet friendly, lo que significa que
|
|
55
|
+
puede viajar con su mascota a bordo.
|
|
56
|
+
</span>
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
59
|
+
</div>
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
) : null}
|
|
27
63
|
<div className="flex gap-[6px]">
|
|
28
64
|
<span style={{ marginTop: "2px" }}>•</span>
|
|
29
65
|
<span>
|
|
@@ -36,18 +72,20 @@ function ExpandedDropdownMobile({
|
|
|
36
72
|
del 85% del monto de tu compra.
|
|
37
73
|
</span>
|
|
38
74
|
</div>
|
|
39
|
-
|
|
40
|
-
<
|
|
41
|
-
|
|
42
|
-
<span
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
75
|
+
{isPeru ? null : (
|
|
76
|
+
<div className="flex gap-[6px]">
|
|
77
|
+
<span style={{ marginTop: "2px" }}>•</span>
|
|
78
|
+
<span>
|
|
79
|
+
<span className="bold-text">Políticas de cambios:</span> Tu pasaje
|
|
80
|
+
puede ser cambiado de manera online{" "}
|
|
81
|
+
<span className="bold-text">
|
|
82
|
+
hasta {serviceItem?.change_ticket_hours || 6} horas antes
|
|
83
|
+
</span>{" "}
|
|
84
|
+
de la salida del bus. El monto será reembolsado a tu billetera
|
|
85
|
+
kupospay.
|
|
86
|
+
</span>
|
|
87
|
+
</div>
|
|
88
|
+
)}
|
|
51
89
|
</div>
|
|
52
90
|
</div>
|
|
53
91
|
);
|