kupos-ui-components-lib 9.10.0 → 9.10.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 +14 -1
- package/dist/KuposUIComponent.js +3 -0
- package/dist/components/ServiceItem/ServiceItemDesktop.d.ts +1 -1
- package/dist/components/ServiceItem/ServiceItemDesktop.js +2 -20
- package/dist/components/ServiceItem/ServiceItemMobile.d.ts +1 -1
- package/dist/components/ServiceItem/ServiceItemMobile.js +2 -2
- package/dist/components/ServiceItem/mobileTypes.d.ts +0 -2
- package/dist/components/ServiceItem/types.d.ts +0 -7
- package/dist/components/Survey/SurveyDesktop.js +17 -16
- package/dist/components/Survey/SurveyMobile.js +17 -16
- package/dist/index.d.ts +5 -1
- package/dist/index.js +9 -1
- package/dist/styles.css +32 -6
- package/dist/ui/SeatSection/SeatSection.d.ts +1 -7
- package/dist/ui/SeatSection/SeatSection.js +9 -38
- package/dist/ui/mobileweb/DateTimeSectionMobile.d.ts +1 -2
- package/dist/ui/mobileweb/DateTimeSectionMobile.js +6 -12
- package/dist/ui/mobileweb/SeatSectionMobile.d.ts +1 -2
- package/dist/ui/mobileweb/SeatSectionMobile.js +14 -21
- package/dist/ui/mobileweb/ServiceBadgesMobile.js +2 -2
- package/dist/utils/CommonService.d.ts +1 -1
- package/dist/utils/CommonService.js +1 -5
- package/package.json +1 -1
- package/src/KuposUIComponent.tsx +22 -1
- package/src/assets/images/anims/service_list/succes_anim.json +1 -0
- package/src/components/ServiceItem/ServiceItemDesktop.tsx +0 -43
- package/src/components/ServiceItem/ServiceItemMobile.tsx +1 -3
- package/src/components/ServiceItem/mobileTypes.ts +26 -32
- package/src/components/ServiceItem/types.ts +0 -12
- package/src/components/Survey/ResponsiveSurvey.tsx +14 -0
- package/src/components/Survey/SurveyDesktop.tsx +121 -0
- package/src/components/Survey/SurveyMobile.tsx +125 -0
- package/src/components/Survey/index.ts +5 -0
- package/src/components/Survey/types.ts +22 -0
- package/src/index.ts +23 -0
- package/src/ui/BottomSheet/BottomSheet.tsx +131 -0
- package/src/ui/BottomSheet/index.ts +2 -0
- package/src/ui/Modal/Modal.tsx +92 -0
- package/src/ui/Modal/ModalHeader.tsx +58 -0
- package/src/ui/Modal/index.ts +4 -0
- package/src/ui/SeatSection/SeatSection.tsx +18 -86
- package/src/ui/Survey/FeedbackBanner.tsx +36 -0
- package/src/ui/Survey/FeedbackTextarea.tsx +84 -0
- package/src/ui/Survey/HeartIcon.tsx +18 -0
- package/src/ui/Survey/ScoreButtons.tsx +91 -0
- package/src/ui/Survey/SurveyFooter.tsx +145 -0
- package/src/ui/Survey/SurveyHeader.tsx +72 -0
- package/src/ui/Survey/ThankYouCard.tsx +100 -0
- package/src/ui/Survey/constants.ts +59 -0
- package/src/ui/Survey/index.ts +9 -0
- package/src/ui/mobileweb/DateTimeSectionMobile.tsx +35 -44
- package/src/ui/mobileweb/SeatSectionMobile.tsx +11 -26
- package/src/ui/mobileweb/ServiceBadgesMobile.tsx +2 -2
- package/src/utils/CommonService.ts +1 -7
|
@@ -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) {
|
|
@@ -103,24 +101,19 @@ function SeatSectionMobile({ seatTypes: seatTypesData, isSoldOut, isPeru, seatPr
|
|
|
103
101
|
React.createElement("span", { className: "min-[420]:text-[13px] text-[12px] text-[#464647]", style: { opacity: isSoldOut ? 0.5 : 1 } }, "Agotado"))) : null));
|
|
104
102
|
};
|
|
105
103
|
const renderSeats = () => {
|
|
106
|
-
var _a, _b;
|
|
104
|
+
var _a, _b, _c;
|
|
107
105
|
if (isPeru) {
|
|
108
106
|
return renderPeruSeats();
|
|
109
107
|
}
|
|
110
108
|
if (removeDuplicateSeats) {
|
|
111
109
|
const uniqueSeats = getUniqueSeats(seatTypesData, 3);
|
|
112
|
-
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]"
|
|
110
|
+
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]" })));
|
|
113
111
|
}
|
|
114
|
-
|
|
115
|
-
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 })));
|
|
112
|
+
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]" })));
|
|
116
113
|
};
|
|
117
114
|
const seats = removeDuplicateSeats
|
|
118
115
|
? getUniqueSeats(seatTypesData, 3)
|
|
119
|
-
: (() =>
|
|
120
|
-
var _a;
|
|
121
|
-
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);
|
|
122
|
-
return isTrain ? filtered : filtered === null || filtered === void 0 ? void 0 : filtered.slice(0, 2);
|
|
123
|
-
})();
|
|
116
|
+
: (_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);
|
|
124
117
|
const discountedSeats = seats === null || seats === void 0 ? void 0 : seats.map((seat) => (Object.assign(Object.assign({}, seat), commonService.calculateDiscountedPrice(seat.fare, serviceItem))));
|
|
125
118
|
const peruLowestFare = isPeru ? getLowestFare() : null;
|
|
126
119
|
const peruDiscountCalc = isPeru && peruLowestFare != null
|
|
@@ -131,7 +124,7 @@ function SeatSectionMobile({ seatTypes: seatTypesData, isSoldOut, isPeru, seatPr
|
|
|
131
124
|
peruDiscountCalc.originalPrice !== peruDiscountCalc.discountedPrice
|
|
132
125
|
: discountedSeats === null || discountedSeats === void 0 ? void 0 : discountedSeats.some((s) => s.originalPrice !== s.discountedPrice);
|
|
133
126
|
const discountSeat = isPeru && peruDiscountCalc
|
|
134
|
-
? Object.assign({ label: "", fare: peruLowestFare }, peruDiscountCalc) : (
|
|
127
|
+
? 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];
|
|
135
128
|
const discountValue = (() => {
|
|
136
129
|
if ((serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.discount_type) === "percentage" &&
|
|
137
130
|
typeof (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.discount_value) === "number") {
|
|
@@ -154,14 +147,14 @@ function SeatSectionMobile({ seatTypes: seatTypesData, isSoldOut, isPeru, seatPr
|
|
|
154
147
|
};
|
|
155
148
|
const originalDpPrice = getMinValue(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.original_dp_price);
|
|
156
149
|
const dpDiscountPercent = getMinValue(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.dp_discount_percents);
|
|
157
|
-
const firstSeatFare = (
|
|
150
|
+
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;
|
|
158
151
|
const hasDpDiscount = (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.dp_discounted_seats) &&
|
|
159
152
|
(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.dp_discount_percents) &&
|
|
160
153
|
originalDpPrice != null &&
|
|
161
154
|
dpDiscountPercent != null &&
|
|
162
155
|
firstSeatFare != null;
|
|
163
156
|
return (React.createElement("div", { className: "content-center relative", style: { width: "40%" } }, (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_dp_enabled) &&
|
|
164
|
-
!((
|
|
157
|
+
!((_g = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.dp_discounted_seats) === null || _g === void 0 ? void 0 : _g.length) &&
|
|
165
158
|
!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] " },
|
|
166
159
|
!isNaN(Number(dpDiscountPercent)) &&
|
|
167
160
|
Number(dpDiscountPercent) > 0 && (React.createElement("div", { className: "absolute -top-[18px] right-[0px]", style: {
|
|
@@ -193,7 +186,7 @@ function SeatSectionMobile({ seatTypes: seatTypesData, isSoldOut, isPeru, seatPr
|
|
|
193
186
|
React.createElement("span", { className: "flex items-center justify-end gap-[4px] text-[14px] bold-text leading-[24px]", style: {
|
|
194
187
|
color: isSoldOut ? "#bbb" : discountSeatPriceColor || "#ff5964",
|
|
195
188
|
} },
|
|
196
|
-
((
|
|
189
|
+
((_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,
|
|
197
190
|
commonService.discountedCurrency(Number(firstSeatFare), currencySign)),
|
|
198
191
|
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,
|
|
199
192
|
React.createElement("div", { className: "relative grid grid-cols-[auto_auto] justify-between gap-x-[8px] " },
|
|
@@ -227,8 +220,8 @@ function SeatSectionMobile({ seatTypes: seatTypesData, isSoldOut, isPeru, seatPr
|
|
|
227
220
|
React.createElement("span", { className: "flex items-center justify-end gap-[4px] text-[14px] bold-text leading-[24px]", style: {
|
|
228
221
|
color: isSoldOut ? "#bbb" : discountSeatPriceColor || "#ff5964",
|
|
229
222
|
} },
|
|
230
|
-
((
|
|
231
|
-
commonService.discountedCurrency(discountSeat.discountedPrice, currencySign))))) : (React.createElement("div", { className:
|
|
223
|
+
((_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,
|
|
224
|
+
commonService.discountedCurrency(discountSeat.discountedPrice, currencySign))))) : (React.createElement("div", { className: "flex flex-col justify-between h-[2.5rem] ", style: {
|
|
232
225
|
gap: isSoldOut ? "0px" : "5px",
|
|
233
226
|
justifyContent: hasMultipleTypes ? "space-between" : "center",
|
|
234
227
|
} },
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
const ServiceBadgesMobile = ({ showTopLabel, isSoldOut, colors, renderIcon, serviceItem, isConexion, }) => {
|
|
3
|
-
return (React.createElement("div", { className: "absolute -top-[
|
|
4
|
-
showTopLabel && (React.createElement("div", { className: `flex items-center gap-[2p x] py-[4px] px-[10px] rounded-[38px] min-[420]:text-[12px] text-[10px] z-20`, style: {
|
|
3
|
+
return (React.createElement("div", { className: "absolute -top-[11px] left-0 w-full flex items-center justify-end gap-[12px] pr-[17px] z-10" },
|
|
4
|
+
showTopLabel && (React.createElement("div", { className: `flex items-center gap-[2p x] py-[4px] px-[10px] rounded-[38px] min-[420]:text-[12px] text-[10px] h-[24px] z-20`, style: {
|
|
5
5
|
backgroundColor: "#fff",
|
|
6
6
|
border: isSoldOut
|
|
7
7
|
? "1px solid #ccc"
|
|
@@ -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)
|
package/package.json
CHANGED
package/src/KuposUIComponent.tsx
CHANGED
|
@@ -9,13 +9,16 @@ import { FilterBarProps } from "./components/FilterBar/tyoes";
|
|
|
9
9
|
import { CuponeraFilterBarProps } from "./components/CuponeraFilterBar/types";
|
|
10
10
|
import { ResponsiveFilterBar } from "./components/FilterBar";
|
|
11
11
|
import ResponsiveCuponeraFilterBar from "./components/CuponeraFilterBar/ResponsiveCuponeraFilterBar";
|
|
12
|
+
import { ResponsiveSurvey, SurveyProps } from "./components/Survey";
|
|
12
13
|
|
|
13
14
|
interface KuposUIComponentProps {
|
|
14
15
|
typeOfComponent:
|
|
15
16
|
| "serviceitem"
|
|
16
17
|
| "paymentsidebar"
|
|
17
18
|
| "servicelist"
|
|
18
|
-
| "filterbar"
|
|
19
|
+
| "filterbar"
|
|
20
|
+
| "survey"
|
|
21
|
+
| "cuponerafilterbar";
|
|
19
22
|
variant?: "mobile" | "desktop";
|
|
20
23
|
|
|
21
24
|
// Original ServiceItem props
|
|
@@ -105,6 +108,21 @@ interface KuposUIComponentProps {
|
|
|
105
108
|
sortOrder?: "asc" | "desc";
|
|
106
109
|
};
|
|
107
110
|
onFilterChange?: (filters: any) => void;
|
|
111
|
+
|
|
112
|
+
// Survey props
|
|
113
|
+
isOpen?: boolean;
|
|
114
|
+
selectedScore?: number | null;
|
|
115
|
+
onScoreChange?: (score: number) => void;
|
|
116
|
+
feedback?: string;
|
|
117
|
+
onFeedbackChange?: (text: string) => void;
|
|
118
|
+
onClose?: () => void;
|
|
119
|
+
onSkip?: () => void;
|
|
120
|
+
onSubmit?: (score: number, feedback: string) => void;
|
|
121
|
+
isSubmitted?: boolean;
|
|
122
|
+
bookingId?: string;
|
|
123
|
+
origin?: string;
|
|
124
|
+
destination?: string;
|
|
125
|
+
operatorName?: string;
|
|
108
126
|
}
|
|
109
127
|
|
|
110
128
|
// Using imported ResponsivePaymentSideBar component instead
|
|
@@ -144,6 +162,9 @@ export default function KuposUIComponent(
|
|
|
144
162
|
/>
|
|
145
163
|
);
|
|
146
164
|
|
|
165
|
+
case "survey":
|
|
166
|
+
return <ResponsiveSurvey {...(restProps as unknown as SurveyProps)} />;
|
|
167
|
+
|
|
147
168
|
default:
|
|
148
169
|
return (
|
|
149
170
|
<div className="error-message">
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"v":"5.7.6","fr":30,"ip":0,"op":60,"w":512,"h":512,"nm":"Checkmark-final","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Capa de formas 6","sr":1,"ks":{"o":{"a":0,"k":67,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[173.75,411.25,0],"ix":2,"l":2},"a":{"a":0,"k":[0,0,0],"ix":1,"l":2},"s":{"a":1,"k":[{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"t":25,"s":[0,0,100]},{"t":39,"s":[3.598,3.598,100]}],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[187.68,187.68],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Trazado elíptico 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"st","c":{"a":0,"k":[1,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":0,"ix":5},"lc":1,"lj":1,"ml":4,"bm":0,"nm":"Trazo 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"gf","o":{"a":0,"k":67,"ix":10},"r":1,"bm":0,"g":{"p":3,"k":{"a":0,"k":[0,0.969,0.576,0.118,0.5,0.957,0.465,0.129,1,0.945,0.353,0.141],"ix":9}},"s":{"a":0,"k":[0,0],"ix":5},"e":{"a":0,"k":[100,0],"ix":6},"t":2,"h":{"a":0,"k":0,"ix":7},"a":{"a":0,"k":0,"ix":8},"nm":"Relleno de degradado 1","mn":"ADBE Vector Graphic - G-Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[1.988,-0.426],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[131.424,131.424],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Elipse 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":60,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"Capa de formas 5","sr":1,"ks":{"o":{"a":0,"k":67,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[423.5,238.5,0],"ix":2,"l":2},"a":{"a":0,"k":[0,0,0],"ix":1,"l":2},"s":{"a":1,"k":[{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"t":36,"s":[0,0,100]},{"t":50,"s":[4.406,4.406,100]}],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[187.68,187.68],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Trazado elíptico 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"st","c":{"a":0,"k":[1,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":0,"ix":5},"lc":1,"lj":1,"ml":4,"bm":0,"nm":"Trazo 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"gf","o":{"a":0,"k":67,"ix":10},"r":1,"bm":0,"g":{"p":3,"k":{"a":0,"k":[0,0.969,0.576,0.118,0.5,0.957,0.465,0.129,1,0.945,0.353,0.141],"ix":9}},"s":{"a":0,"k":[0,0],"ix":5},"e":{"a":0,"k":[100,0],"ix":6},"t":2,"h":{"a":0,"k":0,"ix":7},"a":{"a":0,"k":0,"ix":8},"nm":"Relleno de degradado 1","mn":"ADBE Vector Graphic - G-Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[1.988,-0.426],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[131.424,131.424],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Elipse 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":60,"st":0,"bm":0},{"ddd":0,"ind":3,"ty":4,"nm":"Capa de formas 4","sr":1,"ks":{"o":{"a":0,"k":67,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[100,140,0],"ix":2,"l":2},"a":{"a":0,"k":[0,0,0],"ix":1,"l":2},"s":{"a":1,"k":[{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"t":46,"s":[0,0,100]},{"t":60,"s":[5.219,5.219,100]}],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[187.68,187.68],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Trazado elíptico 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"st","c":{"a":0,"k":[1,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":0,"ix":5},"lc":1,"lj":1,"ml":4,"bm":0,"nm":"Trazo 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"gf","o":{"a":0,"k":67,"ix":10},"r":1,"bm":0,"g":{"p":3,"k":{"a":0,"k":[0,0.969,0.576,0.118,0.5,0.957,0.465,0.129,1,0.945,0.353,0.141],"ix":9}},"s":{"a":0,"k":[0,0],"ix":5},"e":{"a":0,"k":[100,0],"ix":6},"t":2,"h":{"a":0,"k":0,"ix":7},"a":{"a":0,"k":0,"ix":8},"nm":"Relleno de degradado 1","mn":"ADBE Vector Graphic - G-Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[1.988,-0.426],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[131.424,131.424],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Elipse 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":60,"st":0,"bm":0},{"ddd":0,"ind":4,"ty":4,"nm":"Capa 1/Check-Mark-Animation2 contornos","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[256,256,0],"ix":2,"l":2},"a":{"a":0,"k":[256,256,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0]],"v":[[-54.205,3.498],[-19.88,36.986],[54.205,-36.986]],"c":false},"ix":2},"nm":"Trazado 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[1,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":14.2,"ix":5},"lc":2,"lj":1,"ml":10,"bm":0,"nm":"Trazo 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[262.249,261.506],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Grupo 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"tm","s":{"a":0,"k":0,"ix":1},"e":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":21,"s":[0]},{"t":40,"s":[100]}],"ix":2},"o":{"a":0,"k":0,"ix":3},"m":1,"ix":2,"nm":"Recortar trazados 1","mn":"ADBE Vector Filter - Trim","hd":false}],"ip":0,"op":60,"st":0,"bm":0},{"ddd":0,"ind":5,"ty":4,"nm":"CirculoNaranja","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[254,256,0],"ix":2,"l":2},"a":{"a":0,"k":[0,0,0],"ix":1,"l":2},"s":{"a":1,"k":[{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"t":7,"s":[0,0,100]},{"t":25,"s":[100,100,100]}],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[187.68,187.68],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Trazado elíptico 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"st","c":{"a":0,"k":[1,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":0,"ix":5},"lc":1,"lj":1,"ml":4,"bm":0,"nm":"Trazo 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"gf","o":{"a":0,"k":100,"ix":10},"r":1,"bm":0,"g":{"p":3,"k":{"a":0,"k":[0,1,0.655,0.212,0.5,1,0.608,0.241,1,1,0.561,0.271],"ix":9}},"s":{"a":0,"k":[-29,-62],"ix":5},"e":{"a":0,"k":[100,0],"ix":6},"t":2,"h":{"a":0,"k":21,"ix":7},"a":{"a":0,"k":0,"ix":8},"nm":"Relleno de degradado 1","mn":"ADBE Vector Graphic - G-Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[1.988,-0.426],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[131.424,131.424],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Elipse 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":60,"st":0,"bm":0},{"ddd":0,"ind":6,"ty":4,"nm":"CirculoBlanco","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[254,256,0],"ix":2,"l":2},"a":{"a":0,"k":[0,0,0],"ix":1,"l":2},"s":{"a":1,"k":[{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"t":7,"s":[0,0,100]},{"t":25,"s":[109,109,100]}],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[187.68,187.68],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Trazado elíptico 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"st","c":{"a":0,"k":[1,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":0,"ix":5},"lc":1,"lj":1,"ml":4,"bm":0,"nm":"Trazo 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[1,1,1,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[1.988,-0.426],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[131.424,131.424],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Elipse 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":60,"st":0,"bm":0},{"ddd":0,"ind":7,"ty":4,"nm":"CirculoAnaranjadoFondo","sr":1,"ks":{"o":{"a":0,"k":14,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[256,256,0],"ix":2,"l":2},"a":{"a":0,"k":[256,256,0],"ix":1,"l":2},"s":{"a":1,"k":[{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"t":0,"s":[0,0,100]},{"t":20,"s":[100,100,100]}],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[-141.385,0],[0,-141.385],[141.385,0],[0,141.385]],"o":[[141.385,0],[0,141.385],[-141.385,0],[0,-141.385]],"v":[[0,-256],[256,0],[0,256],[-256,0]],"c":true},"ix":2},"nm":"Trazado 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[0.944999964097,0.352999997606,0.141000007181,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Relleno 2","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"fl","c":{"a":0,"k":[1,1,1,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Relleno 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[256,256],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Grupo 1","np":5,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":60,"st":0,"bm":0},{"ddd":0,"ind":8,"ty":4,"nm":"Capa de formas 7","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[250,252,0],"ix":2,"l":2},"a":{"a":0,"k":[0,0,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ty":"rc","d":1,"s":{"a":0,"k":[518.633,518.633],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":0,"ix":4},"nm":"Trazado de rectángulo 1","mn":"ADBE Vector Shape - Rect","hd":false},{"ty":"st","c":{"a":0,"k":[1,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":0,"ix":5},"lc":1,"lj":1,"ml":4,"bm":0,"nm":"Trazo 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[1,1,1,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Relleno 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[3.316,3.316],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Rectángulo 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":60,"st":0,"bm":0}],"markers":[]}
|
|
@@ -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,
|
|
@@ -151,15 +144,6 @@ function ServiceItemPB({
|
|
|
151
144
|
wowDealData,
|
|
152
145
|
isFlores,
|
|
153
146
|
}: ServiceItemProps & { currencySign?: string }): React.ReactElement {
|
|
154
|
-
const handleSeatSelect = (
|
|
155
|
-
key: any,
|
|
156
|
-
price: number,
|
|
157
|
-
seatKey: string,
|
|
158
|
-
apiSeatType?: string,
|
|
159
|
-
) => {
|
|
160
|
-
onClearSeatSelectionError?.();
|
|
161
|
-
onSeatSelect?.(key, price, seatKey, apiSeatType);
|
|
162
|
-
};
|
|
163
147
|
const getAnimationIcon = (icon: string) => {
|
|
164
148
|
const animation = ANIMATION_MAP[icon];
|
|
165
149
|
if (!animation) return null;
|
|
@@ -360,17 +344,6 @@ function ServiceItemPB({
|
|
|
360
344
|
return;
|
|
361
345
|
}
|
|
362
346
|
|
|
363
|
-
if (isTrain) {
|
|
364
|
-
if (!selectedSeatKey) {
|
|
365
|
-
onShowSeatSelectionError?.(serviceItem.id);
|
|
366
|
-
return;
|
|
367
|
-
}
|
|
368
|
-
if (onTrainButtonClick) {
|
|
369
|
-
onTrainButtonClick();
|
|
370
|
-
return;
|
|
371
|
-
}
|
|
372
|
-
}
|
|
373
|
-
|
|
374
347
|
onBookButtonPress();
|
|
375
348
|
};
|
|
376
349
|
|
|
@@ -624,10 +597,6 @@ function ServiceItemPB({
|
|
|
624
597
|
isPeru={isPeru}
|
|
625
598
|
renderIcon={renderIcon}
|
|
626
599
|
discountSeatPriceColor={colors.discountSeatPriceColor}
|
|
627
|
-
isTrain={isTrain}
|
|
628
|
-
selectedSeatKey={selectedSeatKey}
|
|
629
|
-
onSeatSelect={handleSeatSelect}
|
|
630
|
-
topLabelColor={colors.topLabelColor}
|
|
631
600
|
/>
|
|
632
601
|
</div>
|
|
633
602
|
|
|
@@ -643,18 +612,6 @@ function ServiceItemPB({
|
|
|
643
612
|
soldOutIcon={renderIcon("soldOutIcon", "14px")}
|
|
644
613
|
onClick={checkMidnight}
|
|
645
614
|
/>
|
|
646
|
-
{showSeatSelectionError === serviceItem.id && isTrain && (
|
|
647
|
-
<div className="flex justify-center mr-[11px] w-[100%] right-[0px] absolute left-[0] top-[40px]">
|
|
648
|
-
<div
|
|
649
|
-
className="text-[9px] text-center whitespace-nowrap"
|
|
650
|
-
style={{
|
|
651
|
-
color: colors.seatPriceColor,
|
|
652
|
-
}}
|
|
653
|
-
>
|
|
654
|
-
Selecciona el tipo de servicio
|
|
655
|
-
</div>
|
|
656
|
-
</div>
|
|
657
|
-
)}
|
|
658
615
|
{showLastSeats ? (
|
|
659
616
|
<div className="flex justify-center mr-[11px] w-[100%] right-[0px] absolute left-[0] top-[40px]">
|
|
660
617
|
{serviceItem?.available_seats < 10 &&
|
|
@@ -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,
|
|
@@ -232,7 +230,7 @@ function ServiceItemMobile({
|
|
|
232
230
|
style={{
|
|
233
231
|
padding: "12px 12px 8px 12px",
|
|
234
232
|
marginTop:
|
|
235
|
-
serviceItem?.is_direct_trip && showTopLabel
|
|
233
|
+
serviceItem?.is_direct_trip && (showTopLabel || isConexion)
|
|
236
234
|
? " 10px"
|
|
237
235
|
: "",
|
|
238
236
|
}}
|
|
@@ -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,29 +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
|
-
isTrain?: boolean;
|
|
233
|
-
isFeatureDropDownExpand?: any;
|
|
231
|
+
isFeatureDropDownExpand?: any;
|
|
234
232
|
setIsFeatureDropDownExpand?: (value: any) => void;
|
|
235
233
|
ticketQuantity?: number;
|
|
236
|
-
onIncreaseTicketQuantity?: (
|
|
237
|
-
|
|
238
|
-
) => void;
|
|
239
|
-
onDecreaseTicketQuantity?: (
|
|
240
|
-
serviceItem: MobileServiceItemProps["serviceItem"],
|
|
241
|
-
) => void;
|
|
234
|
+
onIncreaseTicketQuantity?: (serviceItem: MobileServiceItemProps["serviceItem"]) => void;
|
|
235
|
+
onDecreaseTicketQuantity?: (serviceItem: MobileServiceItemProps["serviceItem"]) => void;
|
|
242
236
|
cityOrigin?: { value: number; label: string };
|
|
243
237
|
cityDestination?: { value: number; label: string };
|
|
244
|
-
|
|
238
|
+
isNewUi?: boolean
|
|
245
239
|
|
|
246
|
-
|
|
240
|
+
selectedTimeSlot?: string;
|
|
247
241
|
onTimeSlotChange?: (slot: string) => void;
|
|
248
242
|
isTimeDropdownOpen?: string | number | null;
|
|
249
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;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { SurveyProps } from "./types";
|
|
3
|
+
import SurveyDesktop from "./SurveyDesktop";
|
|
4
|
+
import SurveyMobile from "./SurveyMobile";
|
|
5
|
+
|
|
6
|
+
export default function ResponsiveSurvey(props: SurveyProps) {
|
|
7
|
+
const { variant } = props;
|
|
8
|
+
|
|
9
|
+
if (variant === "mobile") {
|
|
10
|
+
return <SurveyMobile {...(props as unknown as SurveyProps)} />;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
return <SurveyDesktop {...props} />;
|
|
14
|
+
}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { SurveyProps } from "./types";
|
|
3
|
+
import { Modal } from "../../ui/Modal";
|
|
4
|
+
import {
|
|
5
|
+
ThankYouCard,
|
|
6
|
+
ScoreButtons,
|
|
7
|
+
FeedbackTextarea,
|
|
8
|
+
getFeedbackConfig,
|
|
9
|
+
} from "../../ui/Survey";
|
|
10
|
+
import KuposButton from "../../ui/KuposButton/KuposButton";
|
|
11
|
+
|
|
12
|
+
const SurveyDesktop = ({
|
|
13
|
+
isOpen,
|
|
14
|
+
isSubmitted,
|
|
15
|
+
selectedScore,
|
|
16
|
+
onScoreChange,
|
|
17
|
+
feedback = "",
|
|
18
|
+
onFeedbackChange,
|
|
19
|
+
onClose,
|
|
20
|
+
onSkip,
|
|
21
|
+
onSubmit,
|
|
22
|
+
colors,
|
|
23
|
+
icons,
|
|
24
|
+
isLoading,
|
|
25
|
+
}: SurveyProps) => {
|
|
26
|
+
if (!isOpen) return null;
|
|
27
|
+
|
|
28
|
+
const config = getFeedbackConfig(selectedScore);
|
|
29
|
+
|
|
30
|
+
const handleSubmit = () => {
|
|
31
|
+
if (selectedScore != null) {
|
|
32
|
+
onSubmit?.(selectedScore, feedback);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<Modal
|
|
38
|
+
isOpen={isOpen}
|
|
39
|
+
onClose={onClose}
|
|
40
|
+
variant="center"
|
|
41
|
+
size="lg"
|
|
42
|
+
maxWidth={550}
|
|
43
|
+
padding={isSubmitted ? 0 : "40px 48px 36px"}
|
|
44
|
+
borderRadius={28}
|
|
45
|
+
closeOnBackdrop={false}
|
|
46
|
+
>
|
|
47
|
+
{/* {isSubmitted ? (
|
|
48
|
+
<ThankYouCard onClose={onClose} />
|
|
49
|
+
) : ( */}
|
|
50
|
+
<>
|
|
51
|
+
{/* Close Button */}
|
|
52
|
+
<button
|
|
53
|
+
onClick={onClose}
|
|
54
|
+
aria-label="Close survey"
|
|
55
|
+
className="absolute top-[15px] right-[25px] bg-transparent border-none cursor-pointer text-[22px] text-gray-400 flex items-center justify-center p-1 z-10 transition-colors duration-200 hover:text-gray-600"
|
|
56
|
+
>
|
|
57
|
+
<img
|
|
58
|
+
src={icons.closeIcon}
|
|
59
|
+
alt="Close"
|
|
60
|
+
className="w-[16px] h-[16px] block"
|
|
61
|
+
/>
|
|
62
|
+
</button>
|
|
63
|
+
|
|
64
|
+
{/* Centered Illustration */}
|
|
65
|
+
{icons?.surveyIcon && (
|
|
66
|
+
<div className="flex justify-center mb-3 mt-2">
|
|
67
|
+
<img
|
|
68
|
+
src={icons.surveyIcon}
|
|
69
|
+
alt="Survey Illustration"
|
|
70
|
+
className="w-[90px] h-[90px] block"
|
|
71
|
+
/>
|
|
72
|
+
</div>
|
|
73
|
+
)}
|
|
74
|
+
|
|
75
|
+
{/* Centered Title */}
|
|
76
|
+
<h2 className="text-[18px] bold-text leading-[1.25] text-center mt-4 mb-2">
|
|
77
|
+
Ayúdanos a mejorar
|
|
78
|
+
</h2>
|
|
79
|
+
|
|
80
|
+
{/* Centered Subtitle */}
|
|
81
|
+
<p className="text-[13.33px] text-center leading-[1.4] mb-6 max-w-[460px] mx-auto">
|
|
82
|
+
Basándote en tu experiencia de compra.
|
|
83
|
+
<br />
|
|
84
|
+
¿Nos recomendarías a un amigo?
|
|
85
|
+
</p>
|
|
86
|
+
|
|
87
|
+
<ScoreButtons
|
|
88
|
+
selectedScore={selectedScore}
|
|
89
|
+
onScoreChange={onScoreChange}
|
|
90
|
+
buttonHeight={45}
|
|
91
|
+
fontSize={15}
|
|
92
|
+
colors={colors}
|
|
93
|
+
/>
|
|
94
|
+
|
|
95
|
+
<FeedbackTextarea
|
|
96
|
+
config={config}
|
|
97
|
+
feedback={feedback}
|
|
98
|
+
onFeedbackChange={onFeedbackChange}
|
|
99
|
+
colors={colors}
|
|
100
|
+
/>
|
|
101
|
+
|
|
102
|
+
{/* Centered Submit Button */}
|
|
103
|
+
<div className="flex justify-center mt-[20px]">
|
|
104
|
+
<div className="w-[180px]">
|
|
105
|
+
<KuposButton
|
|
106
|
+
isSoldOut={selectedScore == null}
|
|
107
|
+
isLoading={isLoading || false}
|
|
108
|
+
buttonColor={"#FF8E43"}
|
|
109
|
+
buyLabel="Enviar"
|
|
110
|
+
soldOutLabel="Enviar"
|
|
111
|
+
onClick={handleSubmit}
|
|
112
|
+
/>
|
|
113
|
+
</div>
|
|
114
|
+
</div>
|
|
115
|
+
</>
|
|
116
|
+
{/* )} */}
|
|
117
|
+
</Modal>
|
|
118
|
+
);
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
export default SurveyDesktop;
|