kupos-ui-components-lib 10.4.61 → 10.4.62
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 +2 -2
- package/dist/components/ServiceItem/ServiceItemMobile.d.ts +1 -1
- package/dist/components/ServiceItem/ServiceItemMobile.js +2 -2
- package/dist/components/ServiceItem/mobileTypes.d.ts +1 -0
- package/dist/components/ServiceItem/types.d.ts +1 -0
- package/dist/ui/SeatSection/SeatSection.d.ts +2 -1
- package/dist/ui/SeatSection/SeatSection.js +6 -2
- package/dist/ui/mobileweb/DateTimeSectionMobile.d.ts +2 -1
- package/dist/ui/mobileweb/DateTimeSectionMobile.js +2 -2
- package/dist/ui/mobileweb/SeatSectionMobile.d.ts +2 -1
- package/dist/ui/mobileweb/SeatSectionMobile.js +2 -2
- package/package.json +1 -1
- package/src/components/ServiceItem/ServiceItemDesktop.tsx +2 -0
- package/src/components/ServiceItem/ServiceItemMobile.tsx +2 -0
- package/src/components/ServiceItem/mobileTypes.ts +2 -0
- package/src/components/ServiceItem/types.ts +2 -0
- package/src/ui/SeatSection/SeatSection.tsx +17 -2
- package/src/ui/mobileweb/DateTimeSectionMobile.tsx +3 -0
- package/src/ui/mobileweb/SeatSectionMobile.tsx +4 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { ServiceItemProps } from "./types";
|
|
3
|
-
declare function ServiceItemPB({ serviceItem, onBookButtonPress, colors, metaData, children, busStage, serviceDetailsLoading, cityOrigin, cityDestination, translation, orignLabel, destinationLabel, currencySign, isCiva, showRating, showLastSeats, removeArrivalTime, removeDuplicateSeats, isPeruSites, showAvailableSeats, isSeatIcon, isLinatal, isPeru, t, siteType, isAllinBus, isExpand, setIsExpand, coachKey, viewersConfig, isNewUi, showLoginModal, isLoggedIn, showLoginOption, isTrain, selectedSeatKey, onSeatSelect, onTrainButtonClick, showSeatSelectionError, onShowSeatSelectionError, onClearSeatSelectionError, isFeatureDropDownExpand, setIsFeatureDropDownExpand, ticketQuantity, onIncreaseTicketQuantity, onDecreaseTicketQuantity, onRemateUiButtonClick, selectedTimeSlot, onTimeSlotChange, isTimeDropdownOpen, onTimeDropdownToggle, wowDealData, isFlores, operatorLabel, priority_stage_ids, isShowSeatIcon, }: ServiceItemProps & {
|
|
3
|
+
declare function ServiceItemPB({ serviceItem, onBookButtonPress, colors, metaData, children, busStage, serviceDetailsLoading, cityOrigin, cityDestination, translation, orignLabel, destinationLabel, currencySign, isCiva, showRating, showLastSeats, removeArrivalTime, removeDuplicateSeats, isPeruSites, showAvailableSeats, isSeatIcon, isLinatal, isPeru, t, siteType, isAllinBus, isExpand, setIsExpand, coachKey, viewersConfig, isNewUi, showLoginModal, isLoggedIn, showLoginOption, isTrain, selectedSeatKey, onSeatSelect, onTrainButtonClick, showSeatSelectionError, onShowSeatSelectionError, onClearSeatSelectionError, isFeatureDropDownExpand, setIsFeatureDropDownExpand, ticketQuantity, onIncreaseTicketQuantity, onDecreaseTicketQuantity, onRemateUiButtonClick, selectedTimeSlot, onTimeSlotChange, isTimeDropdownOpen, onTimeDropdownToggle, wowDealData, isFlores, operatorLabel, priority_stage_ids, isShowSeatIcon, showDesdeLabel, }: ServiceItemProps & {
|
|
4
4
|
currencySign?: string;
|
|
5
5
|
}): React.ReactElement;
|
|
6
6
|
export default ServiceItemPB;
|
|
@@ -87,7 +87,7 @@ const ANIMATION_MAP = {
|
|
|
87
87
|
kupos: flameAnimation,
|
|
88
88
|
},
|
|
89
89
|
};
|
|
90
|
-
function ServiceItemPB({ serviceItem, onBookButtonPress, colors, metaData, children, busStage, serviceDetailsLoading, cityOrigin, cityDestination, translation, orignLabel, destinationLabel, currencySign, isCiva, showRating, showLastSeats, removeArrivalTime, removeDuplicateSeats, isPeruSites, showAvailableSeats, isSeatIcon, isLinatal, isPeru, t = (key) => key, siteType, isAllinBus, isExpand, setIsExpand, coachKey, viewersConfig, isNewUi, showLoginModal, isLoggedIn, showLoginOption, isTrain, selectedSeatKey, onSeatSelect, onTrainButtonClick, showSeatSelectionError, onShowSeatSelectionError, onClearSeatSelectionError, isFeatureDropDownExpand, setIsFeatureDropDownExpand, ticketQuantity, onIncreaseTicketQuantity, onDecreaseTicketQuantity, onRemateUiButtonClick, selectedTimeSlot, onTimeSlotChange, isTimeDropdownOpen, onTimeDropdownToggle, wowDealData, isFlores, operatorLabel, priority_stage_ids, isShowSeatIcon = false, }) {
|
|
90
|
+
function ServiceItemPB({ serviceItem, onBookButtonPress, colors, metaData, children, busStage, serviceDetailsLoading, cityOrigin, cityDestination, translation, orignLabel, destinationLabel, currencySign, isCiva, showRating, showLastSeats, removeArrivalTime, removeDuplicateSeats, isPeruSites, showAvailableSeats, isSeatIcon, isLinatal, isPeru, t = (key) => key, siteType, isAllinBus, isExpand, setIsExpand, coachKey, viewersConfig, isNewUi, showLoginModal, isLoggedIn, showLoginOption, isTrain, selectedSeatKey, onSeatSelect, onTrainButtonClick, showSeatSelectionError, onShowSeatSelectionError, onClearSeatSelectionError, isFeatureDropDownExpand, setIsFeatureDropDownExpand, ticketQuantity, onIncreaseTicketQuantity, onDecreaseTicketQuantity, onRemateUiButtonClick, selectedTimeSlot, onTimeSlotChange, isTimeDropdownOpen, onTimeDropdownToggle, wowDealData, isFlores, operatorLabel, priority_stage_ids, isShowSeatIcon = false, showDesdeLabel = false, }) {
|
|
91
91
|
var _a, _b, _c;
|
|
92
92
|
const handleSeatSelect = (key, price, seatKey, apiSeatType) => {
|
|
93
93
|
onClearSeatSelectionError === null || onClearSeatSelectionError === void 0 ? void 0 : onClearSeatSelectionError();
|
|
@@ -364,7 +364,7 @@ function ServiceItemPB({ serviceItem, onBookButtonPress, colors, metaData, child
|
|
|
364
364
|
backgroundColor: "#ccc",
|
|
365
365
|
} }),
|
|
366
366
|
React.createElement("div", { className: "content-center" },
|
|
367
|
-
React.createElement(SeatSection, { seatTypes: serviceItem.seat_types, serviceItem: serviceItem, availableSeats: serviceItem.available_seats, isSoldOut: isSoldOut, priceColor: colors.priceColor, dpSeatColor: colors.seatPriceColor, currencySign: currencySign, removeDuplicateSeats: removeDuplicateSeats, isPeru: isPeru, renderIcon: renderIcon, discountSeatPriceColor: colors.discountSeatPriceColor, isSeatIcon: isSeatIcon, isTrain: isTrain, selectedSeatKey: selectedSeatKey, onSeatSelect: handleSeatSelect, topLabelColor: colors.topLabelColor, tooltipColor: colors.tooltipColor, discountSeatCrossPriceColor: colors.discountSeatCrossPriceColor, isShowSeatIcon: isShowSeatIcon })),
|
|
367
|
+
React.createElement(SeatSection, { seatTypes: serviceItem.seat_types, serviceItem: serviceItem, availableSeats: serviceItem.available_seats, isSoldOut: isSoldOut, priceColor: colors.priceColor, dpSeatColor: colors.seatPriceColor, currencySign: currencySign, removeDuplicateSeats: removeDuplicateSeats, isPeru: isPeru, renderIcon: renderIcon, discountSeatPriceColor: colors.discountSeatPriceColor, isSeatIcon: isSeatIcon, isTrain: isTrain, selectedSeatKey: selectedSeatKey, onSeatSelect: handleSeatSelect, topLabelColor: colors.topLabelColor, tooltipColor: colors.tooltipColor, discountSeatCrossPriceColor: colors.discountSeatCrossPriceColor, isShowSeatIcon: isShowSeatIcon, showDesdeLabel: showDesdeLabel })),
|
|
368
368
|
React.createElement("div", { className: "relative" },
|
|
369
369
|
React.createElement(KuposButton, { isSoldOut: isSoldOut, isLoading: serviceDetailsLoading, buttonColor: colors.kuposButtonColor, buyLabel: translation === null || translation === void 0 ? void 0 : translation.buyButton, soldOutLabel: translation === null || translation === void 0 ? void 0 : translation.soldOutButton, soldOutIcon: renderIcon("soldOutIcon", "14px"), onClick: checkMidnight }),
|
|
370
370
|
showSeatSelectionError === serviceItem.id && isTrain && (React.createElement("div", { className: "flex justify-center mr-[11px] w-[100%] right-[0px] absolute left-[0] top-[40px]" },
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { MobileServiceItemProps } from "./mobileTypes";
|
|
3
|
-
declare function ServiceItemMobile({ serviceItem, onBookButtonPress, colors, busStage, orignLabel, destinationLabel, amenitiesData, setShowDropdown, showDropdown, isExpanded, setIsExpanded, setAmenetiesAtomValue, isCiva, currencySign, isPeru, showRating, showLastSeats, removeDuplicateSeats, isLinatal, viewersConfig, operatorLabel, isTrain, isFeatureDropDownExpand, setIsFeatureDropDownExpand, ticketQuantity, onIncreaseTicketQuantity, onDecreaseTicketQuantity, cityOrigin, cityDestination, isNewUi, onRemateUiButtonClick, selectedTimeSlot, onTimeSlotChange, isTimeDropdownOpen, onTimeDropdownToggle, wowDealData, isFlores, isAllinBus, isPeruSite, priority_stage_ids, isShowSeatIcon, }: MobileServiceItemProps): React.ReactElement;
|
|
3
|
+
declare function ServiceItemMobile({ serviceItem, onBookButtonPress, colors, busStage, orignLabel, destinationLabel, amenitiesData, setShowDropdown, showDropdown, isExpanded, setIsExpanded, setAmenetiesAtomValue, isCiva, currencySign, isPeru, showRating, showLastSeats, removeDuplicateSeats, isLinatal, viewersConfig, operatorLabel, isTrain, isFeatureDropDownExpand, setIsFeatureDropDownExpand, ticketQuantity, onIncreaseTicketQuantity, onDecreaseTicketQuantity, cityOrigin, cityDestination, isNewUi, onRemateUiButtonClick, selectedTimeSlot, onTimeSlotChange, isTimeDropdownOpen, onTimeDropdownToggle, wowDealData, isFlores, isAllinBus, isPeruSite, priority_stage_ids, isShowSeatIcon, showDesdeLabel, }: MobileServiceItemProps): React.ReactElement;
|
|
4
4
|
export default ServiceItemMobile;
|
|
@@ -19,7 +19,7 @@ const exceptions = [
|
|
|
19
19
|
"blanco",
|
|
20
20
|
"asiento_mascota",
|
|
21
21
|
];
|
|
22
|
-
function ServiceItemMobile({ serviceItem, onBookButtonPress, colors, busStage, orignLabel, destinationLabel, amenitiesData, setShowDropdown, showDropdown, isExpanded, setIsExpanded, setAmenetiesAtomValue, isCiva, currencySign, isPeru, showRating, showLastSeats, removeDuplicateSeats, isLinatal, viewersConfig, operatorLabel, isTrain, isFeatureDropDownExpand, setIsFeatureDropDownExpand, ticketQuantity, onIncreaseTicketQuantity, onDecreaseTicketQuantity, cityOrigin, cityDestination, isNewUi, onRemateUiButtonClick, selectedTimeSlot, onTimeSlotChange, isTimeDropdownOpen, onTimeDropdownToggle, wowDealData, isFlores, isAllinBus, isPeruSite, priority_stage_ids, isShowSeatIcon = false, }) {
|
|
22
|
+
function ServiceItemMobile({ serviceItem, onBookButtonPress, colors, busStage, orignLabel, destinationLabel, amenitiesData, setShowDropdown, showDropdown, isExpanded, setIsExpanded, setAmenetiesAtomValue, isCiva, currencySign, isPeru, showRating, showLastSeats, removeDuplicateSeats, isLinatal, viewersConfig, operatorLabel, isTrain, isFeatureDropDownExpand, setIsFeatureDropDownExpand, ticketQuantity, onIncreaseTicketQuantity, onDecreaseTicketQuantity, cityOrigin, cityDestination, isNewUi, onRemateUiButtonClick, selectedTimeSlot, onTimeSlotChange, isTimeDropdownOpen, onTimeDropdownToggle, wowDealData, isFlores, isAllinBus, isPeruSite, priority_stage_ids, isShowSeatIcon = false, showDesdeLabel = false, }) {
|
|
23
23
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
24
24
|
const isItemExpanded = serviceItem.id === isExpanded;
|
|
25
25
|
const isPetSeat = (Object.keys(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.pet_seat_info) || []).length > 0;
|
|
@@ -154,7 +154,7 @@ function ServiceItemMobile({ serviceItem, onBookButtonPress, colors, busStage, o
|
|
|
154
154
|
color: isSoldOut ? "#bbb" : "text-[#464647]",
|
|
155
155
|
} },
|
|
156
156
|
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)),
|
|
157
|
-
React.createElement(DateTimeSectionMobile, { onBookButtonPress: onBookButtonPress, isCiva: isCiva, isSoldOut: isSoldOut, isLinatal: isLinatal, isPeru: isPeru, orignLabel: orignLabel, destinationLabel: destinationLabel, originIcon: (_g = serviceItem.icons) === null || _g === void 0 ? void 0 : _g.origin, destinationIcon: (_h = serviceItem.icons) === null || _h === void 0 ? void 0 : _h.destination, travelDate: serviceItem.travel_date, arrivalDate: serviceItem.arrival_date, depTime: serviceItem.dep_time, arrTime: serviceItem.arr_time, seatTypes: serviceItem.seat_types, seatPriceColor: colors.seatPriceColor, tooltipBgColor: colors.tooltipBgColor, currencySign: currencySign, availableSeats: serviceItem.available_seats, removeDuplicateSeats: removeDuplicateSeats, serviceItem: serviceItem, showLastSeats: showLastSeats, discountSeatPriceColor: colors.discountSeatPriceColor, isTrain: isTrain, discountSeatCrossPriceColor: colors.discountSeatCrossPriceColor, isShowSeatIcon: isShowSeatIcon }),
|
|
157
|
+
React.createElement(DateTimeSectionMobile, { onBookButtonPress: onBookButtonPress, isCiva: isCiva, isSoldOut: isSoldOut, isLinatal: isLinatal, isPeru: isPeru, orignLabel: orignLabel, destinationLabel: destinationLabel, originIcon: (_g = serviceItem.icons) === null || _g === void 0 ? void 0 : _g.origin, destinationIcon: (_h = serviceItem.icons) === null || _h === void 0 ? void 0 : _h.destination, travelDate: serviceItem.travel_date, arrivalDate: serviceItem.arrival_date, depTime: serviceItem.dep_time, arrTime: serviceItem.arr_time, seatTypes: serviceItem.seat_types, seatPriceColor: colors.seatPriceColor, tooltipBgColor: colors.tooltipBgColor, currencySign: currencySign, availableSeats: serviceItem.available_seats, removeDuplicateSeats: removeDuplicateSeats, serviceItem: serviceItem, showLastSeats: showLastSeats, discountSeatPriceColor: colors.discountSeatPriceColor, isTrain: isTrain, discountSeatCrossPriceColor: colors.discountSeatCrossPriceColor, isShowSeatIcon: isShowSeatIcon, showDesdeLabel: showDesdeLabel }),
|
|
158
158
|
hasDiscount && (React.createElement("div", { className: "flex justify-end" }, isSoldOut ? (React.createElement("span", { className: "col-span-2 min-[420]:text-[13px] text-right text-[12px] text-[#ccc]" }, "Agotado")) : null)),
|
|
159
159
|
showLastSeats ? (React.createElement("div", { className: "flex justify-end " }, (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.available_seats) < 10 &&
|
|
160
160
|
(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.available_seats) > 0 && (React.createElement("div", { className: "text-[10px] text-center", style: {
|
|
@@ -15,6 +15,7 @@ interface SeatSectionProps {
|
|
|
15
15
|
currencySign?: string;
|
|
16
16
|
removeDuplicateSeats?: boolean;
|
|
17
17
|
isPeru?: boolean;
|
|
18
|
+
showDesdeLabel?: boolean;
|
|
18
19
|
serviceItem?: any;
|
|
19
20
|
renderIcon?: (iconKey: string, size?: string) => React.ReactNode;
|
|
20
21
|
discountSeatPriceColor?: string;
|
|
@@ -27,5 +28,5 @@ interface SeatSectionProps {
|
|
|
27
28
|
discountSeatCrossPriceColor?: string;
|
|
28
29
|
isShowSeatIcon?: boolean;
|
|
29
30
|
}
|
|
30
|
-
declare function SeatSection({ seatTypes, availableSeats, isSoldOut, priceColor, currencySign, removeDuplicateSeats, selectedSeatKey, onSeatSelect, isPeru, serviceItem, renderIcon, dpSeatColor, discountSeatPriceColor, isSeatIcon, isTrain, topLabelColor, tooltipColor, discountSeatCrossPriceColor, isShowSeatIcon }: SeatSectionProps): React.ReactElement;
|
|
31
|
+
declare function SeatSection({ seatTypes, availableSeats, isSoldOut, priceColor, currencySign, removeDuplicateSeats, selectedSeatKey, onSeatSelect, isPeru, serviceItem, renderIcon, dpSeatColor, discountSeatPriceColor, isSeatIcon, isTrain, topLabelColor, tooltipColor, discountSeatCrossPriceColor, isShowSeatIcon, showDesdeLabel, }: SeatSectionProps): React.ReactElement;
|
|
31
32
|
export default SeatSection;
|
|
@@ -96,7 +96,7 @@ function addSeatDegree(label) {
|
|
|
96
96
|
return label;
|
|
97
97
|
return String(label).replace(/\b(120|140|160|180)\b(?!°)/g, "$1°");
|
|
98
98
|
}
|
|
99
|
-
function SeatSection({ seatTypes, availableSeats, isSoldOut, priceColor, currencySign, removeDuplicateSeats, selectedSeatKey, onSeatSelect, isPeru, serviceItem, renderIcon, dpSeatColor, discountSeatPriceColor, isSeatIcon, isTrain, topLabelColor, tooltipColor, discountSeatCrossPriceColor, isShowSeatIcon }) {
|
|
99
|
+
function SeatSection({ seatTypes, availableSeats, isSoldOut, priceColor, currencySign, removeDuplicateSeats, selectedSeatKey, onSeatSelect, isPeru, serviceItem, renderIcon, dpSeatColor, discountSeatPriceColor, isSeatIcon, isTrain, topLabelColor, tooltipColor, discountSeatCrossPriceColor, isShowSeatIcon, showDesdeLabel = false, }) {
|
|
100
100
|
var _a;
|
|
101
101
|
const uniqueSeats = getUniqueSeats(seatTypes, isTrain);
|
|
102
102
|
const sortedSeatTypes = getSortedSeatTypes(seatTypes, isTrain);
|
|
@@ -426,6 +426,10 @@ function SeatSection({ seatTypes, availableSeats, isSoldOut, priceColor, currenc
|
|
|
426
426
|
right: 0,
|
|
427
427
|
justifyContent: isCentered ? "center" : "",
|
|
428
428
|
gap: "10px",
|
|
429
|
-
} },
|
|
429
|
+
} }, showDesdeLabel ? (
|
|
430
|
+
// "Desde" sits just above the price without shifting it
|
|
431
|
+
React.createElement("div", { className: "relative flex flex-col", style: { gap: "10px" } },
|
|
432
|
+
React.createElement("span", { className: "text-[12px] font-normal text-[#6a6a6a] absolute whitespace-nowrap", style: { top: "-15px" } }, "Desde"),
|
|
433
|
+
renderSeatPrices())) : (renderSeatPrices()))));
|
|
430
434
|
}
|
|
431
435
|
export default SeatSection;
|
|
@@ -25,6 +25,7 @@ interface DateTimeSectionMobileProps {
|
|
|
25
25
|
isTrain?: boolean;
|
|
26
26
|
discountSeatCrossPriceColor?: string;
|
|
27
27
|
isShowSeatIcon?: boolean;
|
|
28
|
+
showDesdeLabel?: boolean;
|
|
28
29
|
}
|
|
29
|
-
declare function DateTimeSectionMobile({ onBookButtonPress, isCiva, isSoldOut, isLinatal, isPeru, orignLabel, destinationLabel, originIcon, destinationIcon, travelDate, arrivalDate, depTime, arrTime, seatTypes, seatPriceColor, currencySign, availableSeats, removeDuplicateSeats, serviceItem, tooltipBgColor, showLastSeats, discountSeatPriceColor, isTrain, discountSeatCrossPriceColor, isShowSeatIcon, }: DateTimeSectionMobileProps): React.ReactElement;
|
|
30
|
+
declare function DateTimeSectionMobile({ onBookButtonPress, isCiva, isSoldOut, isLinatal, isPeru, orignLabel, destinationLabel, originIcon, destinationIcon, travelDate, arrivalDate, depTime, arrTime, seatTypes, seatPriceColor, currencySign, availableSeats, removeDuplicateSeats, serviceItem, tooltipBgColor, showLastSeats, discountSeatPriceColor, isTrain, discountSeatCrossPriceColor, isShowSeatIcon, showDesdeLabel, }: DateTimeSectionMobileProps): React.ReactElement;
|
|
30
31
|
export default DateTimeSectionMobile;
|
|
@@ -38,7 +38,7 @@ const TimeRow = ({ label, icon, alt, date, timeContent, isSoldOut, }) => {
|
|
|
38
38
|
React.createElement("div", null, "\u2022"),
|
|
39
39
|
React.createElement("div", { className: "font-[900] relative black-text", style: { fontVariantNumeric: "tabular-nums" } }, timeContent))))));
|
|
40
40
|
};
|
|
41
|
-
function DateTimeSectionMobile({ onBookButtonPress, isCiva, isSoldOut, isLinatal, isPeru, orignLabel, destinationLabel, originIcon, destinationIcon, travelDate, arrivalDate, depTime, arrTime, seatTypes, seatPriceColor, currencySign, availableSeats, removeDuplicateSeats, serviceItem, tooltipBgColor, showLastSeats, discountSeatPriceColor, isTrain, discountSeatCrossPriceColor, isShowSeatIcon, }) {
|
|
41
|
+
function DateTimeSectionMobile({ onBookButtonPress, isCiva, isSoldOut, isLinatal, isPeru, orignLabel, destinationLabel, originIcon, destinationIcon, travelDate, arrivalDate, depTime, arrTime, seatTypes, seatPriceColor, currencySign, availableSeats, removeDuplicateSeats, serviceItem, tooltipBgColor, showLastSeats, discountSeatPriceColor, isTrain, discountSeatCrossPriceColor, isShowSeatIcon, showDesdeLabel, }) {
|
|
42
42
|
const { cleaned: cleanedDepTime, hasAM, hasPM } = getCleanedDepTime(depTime);
|
|
43
43
|
const depTimeContent = isLinatal ? (React.createElement("div", null,
|
|
44
44
|
React.createElement("span", null,
|
|
@@ -66,6 +66,6 @@ function DateTimeSectionMobile({ onBookButtonPress, isCiva, isSoldOut, isLinatal
|
|
|
66
66
|
margin: "auto 6px",
|
|
67
67
|
flexShrink: 0,
|
|
68
68
|
} }),
|
|
69
|
-
React.createElement(SeatSectionMobile, { seatTypes: seatTypes, isSoldOut: isSoldOut, isPeru: isPeru, seatPriceColor: seatPriceColor, currencySign: currencySign, availableSeats: availableSeats, removeDuplicateSeats: removeDuplicateSeats, serviceItem: serviceItem, tooltipBgColor: tooltipBgColor, showLastSeats: showLastSeats, discountSeatPriceColor: discountSeatPriceColor, isTrain: isTrain, discountSeatCrossPriceColor: discountSeatCrossPriceColor, isShowSeatIcon: isShowSeatIcon })));
|
|
69
|
+
React.createElement(SeatSectionMobile, { seatTypes: seatTypes, isSoldOut: isSoldOut, isPeru: isPeru, seatPriceColor: seatPriceColor, currencySign: currencySign, availableSeats: availableSeats, removeDuplicateSeats: removeDuplicateSeats, serviceItem: serviceItem, tooltipBgColor: tooltipBgColor, showLastSeats: showLastSeats, discountSeatPriceColor: discountSeatPriceColor, isTrain: isTrain, discountSeatCrossPriceColor: discountSeatCrossPriceColor, isShowSeatIcon: isShowSeatIcon, showDesdeLabel: showDesdeLabel })));
|
|
70
70
|
}
|
|
71
71
|
export default DateTimeSectionMobile;
|
|
@@ -20,6 +20,7 @@ interface SeatSectionMobileProps {
|
|
|
20
20
|
isTrain?: boolean;
|
|
21
21
|
discountSeatCrossPriceColor?: string;
|
|
22
22
|
isShowSeatIcon?: boolean;
|
|
23
|
+
showDesdeLabel?: boolean;
|
|
23
24
|
}
|
|
24
|
-
declare function SeatSectionMobile({ seatTypes: seatTypesData, isSoldOut, isPeru, seatPriceColor, currencySign, availableSeats, removeDuplicateSeats, serviceItem, tooltipBgColor, showLastSeats, discountSeatPriceColor, isTrain, discountSeatCrossPriceColor, isShowSeatIcon, }: SeatSectionMobileProps): React.ReactElement;
|
|
25
|
+
declare function SeatSectionMobile({ seatTypes: seatTypesData, isSoldOut, isPeru, seatPriceColor, currencySign, availableSeats, removeDuplicateSeats, serviceItem, tooltipBgColor, showLastSeats, discountSeatPriceColor, isTrain, discountSeatCrossPriceColor, isShowSeatIcon, showDesdeLabel, }: SeatSectionMobileProps): React.ReactElement;
|
|
25
26
|
export default SeatSectionMobile;
|
|
@@ -63,7 +63,7 @@ const getUniqueSeats = (data, limit) => {
|
|
|
63
63
|
.sort((a, b) => a.fare - b.fare)
|
|
64
64
|
.slice(0, limit);
|
|
65
65
|
};
|
|
66
|
-
function SeatSectionMobile({ seatTypes: seatTypesData, isSoldOut, isPeru, seatPriceColor, currencySign, availableSeats, removeDuplicateSeats, serviceItem, tooltipBgColor, showLastSeats, discountSeatPriceColor, isTrain, discountSeatCrossPriceColor, isShowSeatIcon, }) {
|
|
66
|
+
function SeatSectionMobile({ seatTypes: seatTypesData, isSoldOut, isPeru, seatPriceColor, currencySign, availableSeats, removeDuplicateSeats, serviceItem, tooltipBgColor, showLastSeats, discountSeatPriceColor, isTrain, discountSeatCrossPriceColor, isShowSeatIcon, showDesdeLabel = false, }) {
|
|
67
67
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
68
68
|
const hasMultipleTypes = ((_a = seatTypesData === null || seatTypesData === void 0 ? void 0 : seatTypesData.length) !== null && _a !== void 0 ? _a : 0) > 2;
|
|
69
69
|
const isMovilBus = (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.operator_service_name) === "MovilBus" ||
|
|
@@ -134,7 +134,7 @@ function SeatSectionMobile({ seatTypes: seatTypesData, isSoldOut, isPeru, seatPr
|
|
|
134
134
|
React.createElement("span", { className: "min-[420]:text-[13px] text-[12px]", style: { color: "#bbb" } }, "Antes"),
|
|
135
135
|
React.createElement("span", { className: "min-[420]:text-[13px] text-[12px] line-through", style: { color: "#bbb" } }, commonService.currency(originalPrice, currencySign)))),
|
|
136
136
|
React.createElement("div", { className: "relative w-[100%] flex flex-row justify-between items-center" },
|
|
137
|
-
hasInclination && !hasStrikeOff && (React.createElement("span", { className: "min-[420]:text-[13px] text-[12px] absolute", style: { color: "#6a6a6a", top: -20, right: 0 } }, "Desde")),
|
|
137
|
+
(hasInclination || showDesdeLabel) && !hasStrikeOff && (React.createElement("span", { className: "min-[420]:text-[13px] text-[12px] absolute", style: { color: "#6a6a6a", top: -20, right: 0 } }, "Desde")),
|
|
138
138
|
React.createElement("span", { className: "min-[420]:text-[13px] text-[12px] bold-text flex items-center", style: { color: isSoldOut ? "#bbb" : "#464647" } },
|
|
139
139
|
seatLabelIcon && (React.createElement("img", { src: seatLabelIcon, alt: "seattype", style: {
|
|
140
140
|
width: "16px",
|
package/package.json
CHANGED
|
@@ -153,6 +153,7 @@ function ServiceItemPB({
|
|
|
153
153
|
operatorLabel,
|
|
154
154
|
priority_stage_ids,
|
|
155
155
|
isShowSeatIcon = false,
|
|
156
|
+
showDesdeLabel = false,
|
|
156
157
|
}: ServiceItemProps & { currencySign?: string }): React.ReactElement {
|
|
157
158
|
const handleSeatSelect = (
|
|
158
159
|
key: any,
|
|
@@ -715,6 +716,7 @@ function ServiceItemPB({
|
|
|
715
716
|
colors.discountSeatCrossPriceColor
|
|
716
717
|
}
|
|
717
718
|
isShowSeatIcon={isShowSeatIcon}
|
|
719
|
+
showDesdeLabel={showDesdeLabel}
|
|
718
720
|
/>
|
|
719
721
|
</div>
|
|
720
722
|
|
|
@@ -68,6 +68,7 @@ function ServiceItemMobile({
|
|
|
68
68
|
isPeruSite,
|
|
69
69
|
priority_stage_ids,
|
|
70
70
|
isShowSeatIcon = false,
|
|
71
|
+
showDesdeLabel = false,
|
|
71
72
|
}: MobileServiceItemProps): React.ReactElement {
|
|
72
73
|
const isItemExpanded = serviceItem.id === isExpanded;
|
|
73
74
|
const isPetSeat = (Object.keys(serviceItem?.pet_seat_info) || []).length > 0;
|
|
@@ -397,6 +398,7 @@ function ServiceItemMobile({
|
|
|
397
398
|
isTrain={isTrain}
|
|
398
399
|
discountSeatCrossPriceColor={colors.discountSeatCrossPriceColor}
|
|
399
400
|
isShowSeatIcon={isShowSeatIcon}
|
|
401
|
+
showDesdeLabel={showDesdeLabel}
|
|
400
402
|
/>
|
|
401
403
|
|
|
402
404
|
{hasDiscount && (
|
|
@@ -20,6 +20,7 @@ interface SeatSectionProps {
|
|
|
20
20
|
currencySign?: string;
|
|
21
21
|
removeDuplicateSeats?: boolean;
|
|
22
22
|
isPeru?: boolean;
|
|
23
|
+
showDesdeLabel?: boolean;
|
|
23
24
|
serviceItem?: any;
|
|
24
25
|
renderIcon?: (iconKey: string, size?: string) => React.ReactNode;
|
|
25
26
|
discountSeatPriceColor?: string;
|
|
@@ -162,7 +163,8 @@ function SeatSection({
|
|
|
162
163
|
topLabelColor,
|
|
163
164
|
tooltipColor,
|
|
164
165
|
discountSeatCrossPriceColor,
|
|
165
|
-
isShowSeatIcon
|
|
166
|
+
isShowSeatIcon,
|
|
167
|
+
showDesdeLabel = false,
|
|
166
168
|
}: SeatSectionProps): React.ReactElement {
|
|
167
169
|
const uniqueSeats = getUniqueSeats(seatTypes, isTrain);
|
|
168
170
|
const sortedSeatTypes = getSortedSeatTypes(seatTypes, isTrain);
|
|
@@ -824,7 +826,20 @@ function SeatSection({
|
|
|
824
826
|
gap: "10px",
|
|
825
827
|
}}
|
|
826
828
|
>
|
|
827
|
-
{
|
|
829
|
+
{showDesdeLabel ? (
|
|
830
|
+
// "Desde" sits just above the price without shifting it
|
|
831
|
+
<div className="relative flex flex-col" style={{ gap: "10px" }}>
|
|
832
|
+
<span
|
|
833
|
+
className="text-[12px] font-normal text-[#6a6a6a] absolute whitespace-nowrap"
|
|
834
|
+
style={{ top: "-15px" }}
|
|
835
|
+
>
|
|
836
|
+
Desde
|
|
837
|
+
</span>
|
|
838
|
+
{renderSeatPrices()}
|
|
839
|
+
</div>
|
|
840
|
+
) : (
|
|
841
|
+
renderSeatPrices()
|
|
842
|
+
)}
|
|
828
843
|
</div>
|
|
829
844
|
</div>
|
|
830
845
|
);
|
|
@@ -28,6 +28,7 @@ interface DateTimeSectionMobileProps {
|
|
|
28
28
|
isTrain?: boolean;
|
|
29
29
|
discountSeatCrossPriceColor?: string;
|
|
30
30
|
isShowSeatIcon?: boolean;
|
|
31
|
+
showDesdeLabel?: boolean;
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
const pad = (n: number) => (n < 10 ? "0" + n : String(n));
|
|
@@ -149,6 +150,7 @@ function DateTimeSectionMobile({
|
|
|
149
150
|
isTrain,
|
|
150
151
|
discountSeatCrossPriceColor,
|
|
151
152
|
isShowSeatIcon,
|
|
153
|
+
showDesdeLabel,
|
|
152
154
|
}: DateTimeSectionMobileProps): React.ReactElement {
|
|
153
155
|
const { cleaned: cleanedDepTime, hasAM, hasPM } = getCleanedDepTime(depTime);
|
|
154
156
|
|
|
@@ -231,6 +233,7 @@ function DateTimeSectionMobile({
|
|
|
231
233
|
isTrain={isTrain}
|
|
232
234
|
discountSeatCrossPriceColor={discountSeatCrossPriceColor}
|
|
233
235
|
isShowSeatIcon={isShowSeatIcon}
|
|
236
|
+
showDesdeLabel={showDesdeLabel}
|
|
234
237
|
/>
|
|
235
238
|
</div>
|
|
236
239
|
);
|
|
@@ -35,6 +35,8 @@ interface SeatSectionMobileProps {
|
|
|
35
35
|
isTrain?: boolean;
|
|
36
36
|
discountSeatCrossPriceColor?: string;
|
|
37
37
|
isShowSeatIcon?: boolean;
|
|
38
|
+
// shows "Desde" above the price on every service, not only inclination ones
|
|
39
|
+
showDesdeLabel?: boolean;
|
|
38
40
|
}
|
|
39
41
|
|
|
40
42
|
interface SeatRowProps {
|
|
@@ -151,6 +153,7 @@ function SeatSectionMobile({
|
|
|
151
153
|
isTrain,
|
|
152
154
|
discountSeatCrossPriceColor,
|
|
153
155
|
isShowSeatIcon,
|
|
156
|
+
showDesdeLabel = false,
|
|
154
157
|
}: SeatSectionMobileProps): React.ReactElement {
|
|
155
158
|
const hasMultipleTypes = (seatTypesData?.length ?? 0) > 2;
|
|
156
159
|
|
|
@@ -297,7 +300,7 @@ function SeatSectionMobile({
|
|
|
297
300
|
)}
|
|
298
301
|
<div className="relative w-[100%] flex flex-row justify-between items-center">
|
|
299
302
|
{/* Inclination fares sit under "Desde", same as the stacked rows above. */}
|
|
300
|
-
{hasInclination && !hasStrikeOff && (
|
|
303
|
+
{(hasInclination || showDesdeLabel) && !hasStrikeOff && (
|
|
301
304
|
<span
|
|
302
305
|
className="min-[420]:text-[13px] text-[12px] absolute"
|
|
303
306
|
style={{ color: "#6a6a6a", top: -20, right: 0 }}
|