kupos-ui-components-lib 10.4.24 → 10.4.25
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.js +1 -1
- package/dist/components/ServiceItem/ServiceItemMobile.js +18 -11
- package/dist/ui/OfferBanner.js +1 -1
- package/package.json +1 -1
- package/src/components/ServiceItem/ServiceItemDesktop.tsx +3 -2
- package/src/components/ServiceItem/ServiceItemMobile.tsx +106 -95
- package/src/ui/OfferBanner.tsx +1 -1
|
@@ -139,7 +139,7 @@ function ServiceItemPB({ serviceItem, onBookButtonPress, colors, metaData, child
|
|
|
139
139
|
const grayscaleClass = isSoldOut ? "grayscale" : "";
|
|
140
140
|
const isDiscountBelow20 = (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.discount_value) > 0 &&
|
|
141
141
|
(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.discount_value) < 20;
|
|
142
|
-
const hasOfferText = Boolean(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.offer_text)
|
|
142
|
+
const hasOfferText = Boolean(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.offer_text);
|
|
143
143
|
const isNewUiEnabledPeru = ((_b = (_a = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.discounts) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.new_ui_enabled) === true;
|
|
144
144
|
const isNewUiEnabled = (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.new_ui_enabled) === true;
|
|
145
145
|
const seats = removeDuplicateSeats
|
|
@@ -32,11 +32,13 @@ function ServiceItemMobile({ serviceItem, onBookButtonPress, colors, busStage, o
|
|
|
32
32
|
const hasDiscount = discountedSeats.some((seat) => seat.originalPrice !== seat.discountedPrice);
|
|
33
33
|
const isLongOfferText = (((_d = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.offer_text) === null || _d === void 0 ? void 0 : _d.length) || 0) > 35;
|
|
34
34
|
const hasDpEnabled = (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_dp_enabled) === true;
|
|
35
|
-
const isDiscountBelow20 = (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.discount_value) > 0 &&
|
|
36
|
-
|
|
35
|
+
const isDiscountBelow20 = (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.discount_value) > 0 &&
|
|
36
|
+
(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.discount_value) < 20;
|
|
37
|
+
const hasOfferText = Boolean(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.offer_text);
|
|
37
38
|
const offerGradient = `linear-gradient(90deg, ${colors.rightGradiantColor || "#ff5964"} 0%, ${colors.leftGradiantColor || "#ff8842"} 100%)`;
|
|
38
39
|
const offerGradientWithOpacity = `linear-gradient(90deg, ${colors.rightGradiantColor || "#ff5964"}80 0%, ${colors.leftGradiantColor || "#ff8842"}80 100%)`;
|
|
39
|
-
const serviceCardStyle = (isNewUiEnabled && (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.ui_type) === 2) ||
|
|
40
|
+
const serviceCardStyle = (isNewUiEnabled && (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.ui_type) === 2) ||
|
|
41
|
+
((serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_dp_enabled) && (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.dp_discount_percents))
|
|
40
42
|
? {
|
|
41
43
|
borderColor: isSoldOut ? "#ccc" : "transparent",
|
|
42
44
|
borderStyle: "solid",
|
|
@@ -126,7 +128,8 @@ function ServiceItemMobile({ serviceItem, onBookButtonPress, colors, busStage, o
|
|
|
126
128
|
? "mt-[20px]"
|
|
127
129
|
: "mt-[10px]"} `, style: { zIndex: 1 } },
|
|
128
130
|
React.createElement("div", { className: `z-1 ${((isNewUiEnabled && (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.ui_type) === 2) ||
|
|
129
|
-
((serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_dp_enabled) &&
|
|
131
|
+
((serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_dp_enabled) &&
|
|
132
|
+
(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.dp_discount_percents))) &&
|
|
130
133
|
!isSoldOut
|
|
131
134
|
? "rounded-[18px]"
|
|
132
135
|
: "rounded-[10px] border border-[#ccc]"}`, style: Object.assign(Object.assign({}, serviceCardStyle), { backgroundColor: "#fff" }) },
|
|
@@ -163,7 +166,8 @@ function ServiceItemMobile({ serviceItem, onBookButtonPress, colors, busStage, o
|
|
|
163
166
|
}, isPeru: isPeru, femaleAnim: serviceItem.icons.femaleAnim, ladiesBookedSeats: serviceItem.ladies_booked_seats, isDpEnabled: serviceItem.is_dp_enabled, isTrain: isTrain })),
|
|
164
167
|
React.createElement(ServiceBadgesMobile, { showTopLabel: showTopLabel || undefined, isSoldOut: isSoldOut, colors: colors, renderIcon: renderIcon, serviceItem: serviceItem, isConexion: isConexion, isAllinBus: isAllinBus, boardingName: boardingName })),
|
|
165
168
|
hasOfferText &&
|
|
166
|
-
|
|
169
|
+
isNewUiEnabled &&
|
|
170
|
+
(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.ui_type) === 1 &&
|
|
167
171
|
!isSoldOut &&
|
|
168
172
|
!(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_dp_enabled) && (React.createElement("div", { className: "px-[12px] pt-[22px] pb-[8px] relative -z-9 -mt-[15px]", style: {
|
|
169
173
|
background: colors === null || colors === void 0 ? void 0 : colors.bottomStripColor,
|
|
@@ -180,7 +184,10 @@ function ServiceItemMobile({ serviceItem, onBookButtonPress, colors, busStage, o
|
|
|
180
184
|
lineHeight: 1.4,
|
|
181
185
|
} },
|
|
182
186
|
React.createElement("span", { className: "whitespace-nowrap min-[380px]:text-[12px]" }, serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.offer_text))))))),
|
|
183
|
-
((isNewUiEnabled && (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.ui_type) === 2) ||
|
|
187
|
+
((isNewUiEnabled && (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.ui_type) === 2) ||
|
|
188
|
+
((serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_dp_enabled) &&
|
|
189
|
+
(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.dp_discount_percents))) &&
|
|
190
|
+
!isSoldOut && (React.createElement("div", { className: "px-[12px] pt-[22px] pb-[8px] relative -z-9 -mt-[15px]", style: {
|
|
184
191
|
background: isSoldOut
|
|
185
192
|
? offerGradientWithOpacity
|
|
186
193
|
: offerGradient,
|
|
@@ -232,7 +239,8 @@ function ServiceItemMobile({ serviceItem, onBookButtonPress, colors, busStage, o
|
|
|
232
239
|
transition: "grid-template-rows 0.3s ease-in-out, opacity 0.25s ease-in-out",
|
|
233
240
|
position: "relative",
|
|
234
241
|
zIndex: hasOfferText ||
|
|
235
|
-
((serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_dp_enabled) &&
|
|
242
|
+
((serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_dp_enabled) &&
|
|
243
|
+
(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.dp_discount_percents)) ||
|
|
236
244
|
(isNewUiEnabled && (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.ui_type) === 2)
|
|
237
245
|
? -2
|
|
238
246
|
: -1,
|
|
@@ -240,14 +248,13 @@ function ServiceItemMobile({ serviceItem, onBookButtonPress, colors, busStage, o
|
|
|
240
248
|
React.createElement("div", { style: {
|
|
241
249
|
overflow: "hidden",
|
|
242
250
|
minHeight: 0,
|
|
243
|
-
position: hasOfferText ||
|
|
244
|
-
isNewUiEnabled ||
|
|
245
|
-
(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_dp_enabled)
|
|
251
|
+
position: hasOfferText || isNewUiEnabled || (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_dp_enabled)
|
|
246
252
|
? "relative"
|
|
247
253
|
: undefined,
|
|
248
254
|
zIndex: (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.offer_text) ||
|
|
249
255
|
(isNewUiEnabled && (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.ui_type) === 2) ||
|
|
250
|
-
((serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_dp_enabled) &&
|
|
256
|
+
((serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_dp_enabled) &&
|
|
257
|
+
(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.dp_discount_percents))
|
|
251
258
|
? -3
|
|
252
259
|
: undefined,
|
|
253
260
|
marginTop: hasOfferText ? "-15px" : "-10px",
|
package/dist/ui/OfferBanner.js
CHANGED
|
@@ -59,7 +59,7 @@ const ViewersCount = ({ serviceItem, viewersConfig, getAnimationIcon, }) => {
|
|
|
59
59
|
const OfferBanner = ({ offerGradient, isSoldOut, serviceItem, isLoggedIn, showLoginModal, viewersConfig, getAnimationIcon, showLoginOption, isNewUiEnabled, colors, isLinatal, coachKey, isExpand, }) => {
|
|
60
60
|
const isDiscountBelow20 = (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.discount_value) > 0 &&
|
|
61
61
|
(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.discount_value) < 20;
|
|
62
|
-
const offerText =
|
|
62
|
+
const offerText = (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.offer_text) || "";
|
|
63
63
|
const isLegacyOffer = !!offerText &&
|
|
64
64
|
isNewUiEnabled &&
|
|
65
65
|
(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.ui_type) === 1 &&
|
package/package.json
CHANGED
|
@@ -233,8 +233,9 @@ function ServiceItemPB({
|
|
|
233
233
|
const isDiscountBelow20 =
|
|
234
234
|
(serviceItem as any)?.discount_value > 0 &&
|
|
235
235
|
(serviceItem as any)?.discount_value < 20;
|
|
236
|
-
const hasOfferText = Boolean(serviceItem?.offer_text)
|
|
237
|
-
const isNewUiEnabledPeru =
|
|
236
|
+
const hasOfferText = Boolean(serviceItem?.offer_text);
|
|
237
|
+
const isNewUiEnabledPeru =
|
|
238
|
+
serviceItem?.discounts?.[0]?.new_ui_enabled === true;
|
|
238
239
|
const isNewUiEnabled = serviceItem?.new_ui_enabled === true;
|
|
239
240
|
|
|
240
241
|
const seats = removeDuplicateSeats
|
|
@@ -92,12 +92,15 @@ function ServiceItemMobile({
|
|
|
92
92
|
const isLongOfferText = (serviceItem?.offer_text?.length || 0) > 35;
|
|
93
93
|
const hasDpEnabled = serviceItem?.is_dp_enabled === true;
|
|
94
94
|
|
|
95
|
-
const isDiscountBelow20 =
|
|
96
|
-
|
|
95
|
+
const isDiscountBelow20 =
|
|
96
|
+
(serviceItem as any)?.discount_value > 0 &&
|
|
97
|
+
(serviceItem as any)?.discount_value < 20;
|
|
98
|
+
const hasOfferText = Boolean(serviceItem?.offer_text);
|
|
97
99
|
const offerGradient = `linear-gradient(90deg, ${colors.rightGradiantColor || "#ff5964"} 0%, ${colors.leftGradiantColor || "#ff8842"} 100%)`;
|
|
98
100
|
const offerGradientWithOpacity = `linear-gradient(90deg, ${colors.rightGradiantColor || "#ff5964"}80 0%, ${colors.leftGradiantColor || "#ff8842"}80 100%)`;
|
|
99
101
|
const serviceCardStyle: React.CSSProperties =
|
|
100
|
-
(isNewUiEnabled && serviceItem?.ui_type === 2) ||
|
|
102
|
+
(isNewUiEnabled && serviceItem?.ui_type === 2) ||
|
|
103
|
+
(serviceItem?.is_dp_enabled && serviceItem?.dp_discount_percents)
|
|
101
104
|
? {
|
|
102
105
|
borderColor: isSoldOut ? "#ccc" : "transparent",
|
|
103
106
|
borderStyle: "solid",
|
|
@@ -294,7 +297,8 @@ function ServiceItemMobile({
|
|
|
294
297
|
<div
|
|
295
298
|
className={`z-1 ${
|
|
296
299
|
((isNewUiEnabled && serviceItem?.ui_type === 2) ||
|
|
297
|
-
(serviceItem?.is_dp_enabled &&
|
|
300
|
+
(serviceItem?.is_dp_enabled &&
|
|
301
|
+
serviceItem?.dp_discount_percents)) &&
|
|
298
302
|
!isSoldOut
|
|
299
303
|
? "rounded-[18px]"
|
|
300
304
|
: "rounded-[10px] border border-[#ccc]"
|
|
@@ -466,7 +470,8 @@ function ServiceItemMobile({
|
|
|
466
470
|
|
|
467
471
|
{/* 🔹 EXPANDABLE DROPDOWN (below the card) */}
|
|
468
472
|
{hasOfferText &&
|
|
469
|
-
|
|
473
|
+
isNewUiEnabled &&
|
|
474
|
+
serviceItem?.ui_type === 1 &&
|
|
470
475
|
!isSoldOut &&
|
|
471
476
|
!serviceItem?.is_dp_enabled && (
|
|
472
477
|
<div
|
|
@@ -510,113 +515,119 @@ function ServiceItemMobile({
|
|
|
510
515
|
)}
|
|
511
516
|
|
|
512
517
|
{/* 🔹 EXPANDABLE DROPDOWN (below the card) */}
|
|
513
|
-
{((isNewUiEnabled && serviceItem?.ui_type === 2) ||
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
background: isSoldOut
|
|
518
|
-
? offerGradientWithOpacity
|
|
519
|
-
: offerGradient,
|
|
520
|
-
// opacity: isSoldOut ? 0.5 : 1,
|
|
521
|
-
borderRadius: "0 0 14px 14px",
|
|
522
|
-
zIndex: -1,
|
|
523
|
-
}}
|
|
524
|
-
>
|
|
518
|
+
{((isNewUiEnabled && serviceItem?.ui_type === 2) ||
|
|
519
|
+
(serviceItem?.is_dp_enabled &&
|
|
520
|
+
serviceItem?.dp_discount_percents)) &&
|
|
521
|
+
!isSoldOut && (
|
|
525
522
|
<div
|
|
526
|
-
className="
|
|
527
|
-
style={{
|
|
523
|
+
className="px-[12px] pt-[22px] pb-[8px] relative -z-9 -mt-[15px]"
|
|
524
|
+
style={{
|
|
525
|
+
background: isSoldOut
|
|
526
|
+
? offerGradientWithOpacity
|
|
527
|
+
: offerGradient,
|
|
528
|
+
// opacity: isSoldOut ? 0.5 : 1,
|
|
529
|
+
borderRadius: "0 0 14px 14px",
|
|
530
|
+
zIndex: -1,
|
|
531
|
+
}}
|
|
528
532
|
>
|
|
529
|
-
<div
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
/>
|
|
541
|
-
|
|
542
|
-
<span className="text-[#fff]">Más elegido</span>
|
|
543
|
-
</div>
|
|
544
|
-
) : (
|
|
545
|
-
<div
|
|
546
|
-
className={`flex ${(serviceItem?.offer_text || "").length > 10 ? "items-start" : "items-center"}`}
|
|
547
|
-
>
|
|
548
|
-
<div className={isLongOfferText ? "mt-[2px]" : ""}>
|
|
533
|
+
<div
|
|
534
|
+
className="flex flex-col gap-[8px] text-[12px] min-[420px]:text-[12px] text-[#464647]"
|
|
535
|
+
style={{ lineHeight: 1.6 }}
|
|
536
|
+
>
|
|
537
|
+
<div className="flex justify-between items-center">
|
|
538
|
+
{serviceItem?.is_dp_enabled &&
|
|
539
|
+
Object.keys(serviceItem?.dp_discount_percents ?? {})
|
|
540
|
+
.length === 0 &&
|
|
541
|
+
(serviceItem?.dp_discounted_seats ?? []).length === 0 ? (
|
|
542
|
+
<div className="flex items-center gap-[6px]">
|
|
543
|
+
{/* {renderIcon("whiteFireIcon", "14px")} */}
|
|
549
544
|
<LottiePlayer
|
|
550
|
-
animationData={serviceItem.icons.
|
|
545
|
+
animationData={serviceItem.icons.starAnimation}
|
|
551
546
|
width="14px"
|
|
552
547
|
height="14px"
|
|
553
548
|
/>
|
|
549
|
+
|
|
550
|
+
<span className="text-[#fff]">Más elegido</span>
|
|
554
551
|
</div>
|
|
552
|
+
) : (
|
|
555
553
|
<div
|
|
556
|
-
className={`
|
|
557
|
-
style={{
|
|
558
|
-
color: "#fff",
|
|
559
|
-
lineHeight: 1.4,
|
|
560
|
-
}}
|
|
554
|
+
className={`flex ${(serviceItem?.offer_text || "").length > 10 ? "items-start" : "items-center"}`}
|
|
561
555
|
>
|
|
562
|
-
<
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
commonService.startCountdown(node, 599)
|
|
568
|
-
}
|
|
569
|
-
style={{
|
|
570
|
-
fontVariantNumeric: "tabular-nums",
|
|
571
|
-
display: "inline-block",
|
|
572
|
-
}}
|
|
556
|
+
<div className={isLongOfferText ? "mt-[2px]" : ""}>
|
|
557
|
+
<LottiePlayer
|
|
558
|
+
animationData={serviceItem.icons.bombAnim}
|
|
559
|
+
width="14px"
|
|
560
|
+
height="14px"
|
|
573
561
|
/>
|
|
574
|
-
</
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
562
|
+
</div>
|
|
563
|
+
<div
|
|
564
|
+
className={`ml-[4px] flex-1 outline-none ${isLongOfferText ? "mt-[2px]" : ""}`}
|
|
565
|
+
style={{
|
|
566
|
+
color: "#fff",
|
|
567
|
+
lineHeight: 1.4,
|
|
568
|
+
}}
|
|
569
|
+
>
|
|
570
|
+
<span className="whitespace-nowrap min-[380px]:text-[12px]">
|
|
571
|
+
Termina en
|
|
572
|
+
<span
|
|
573
|
+
className="bold-text"
|
|
574
|
+
ref={(node) =>
|
|
575
|
+
commonService.startCountdown(node, 599)
|
|
576
|
+
}
|
|
577
|
+
style={{
|
|
578
|
+
fontVariantNumeric: "tabular-nums",
|
|
579
|
+
display: "inline-block",
|
|
580
|
+
}}
|
|
581
|
+
/>
|
|
582
|
+
</span>
|
|
583
|
+
</div>
|
|
592
584
|
</div>
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
<
|
|
602
|
-
|
|
603
|
-
|
|
585
|
+
)}
|
|
586
|
+
<div
|
|
587
|
+
className="flex flex-col items-end"
|
|
588
|
+
style={{
|
|
589
|
+
color: "#fff",
|
|
590
|
+
}}
|
|
591
|
+
>
|
|
592
|
+
<div className="flex items-center">
|
|
593
|
+
<div className="mr-[4px]">
|
|
594
|
+
{" "}
|
|
595
|
+
<LottiePlayer
|
|
596
|
+
animationData={serviceItem.icons.dotAnimation}
|
|
597
|
+
width="12px"
|
|
598
|
+
height="12px"
|
|
599
|
+
/>
|
|
600
|
+
</div>
|
|
601
|
+
<span className="flex-1" style={{ lineHeight: 1.4 }}>
|
|
604
602
|
<span
|
|
605
603
|
className="bold-text"
|
|
606
604
|
ref={(node) =>
|
|
607
|
-
commonService.
|
|
605
|
+
commonService.startViewerCount(
|
|
606
|
+
node,
|
|
607
|
+
viewersConfig,
|
|
608
|
+
)
|
|
608
609
|
}
|
|
609
610
|
style={{ fontVariantNumeric: "tabular-nums" }}
|
|
610
611
|
/>{" "}
|
|
611
|
-
|
|
612
|
+
<span> viendo</span> |{" "}
|
|
613
|
+
<span className="whitespace-nowrap">
|
|
614
|
+
{/* {serviceItem?.is_dp_enabled ? null : "Quedan pocos • "} */}
|
|
615
|
+
<span
|
|
616
|
+
className="bold-text"
|
|
617
|
+
ref={(node) =>
|
|
618
|
+
commonService.startComprandoCount(node, 4, 16)
|
|
619
|
+
}
|
|
620
|
+
style={{ fontVariantNumeric: "tabular-nums" }}
|
|
621
|
+
/>{" "}
|
|
622
|
+
comprando
|
|
623
|
+
</span>
|
|
612
624
|
</span>
|
|
613
|
-
</
|
|
625
|
+
</div>
|
|
614
626
|
</div>
|
|
615
627
|
</div>
|
|
616
628
|
</div>
|
|
617
629
|
</div>
|
|
618
|
-
|
|
619
|
-
)}
|
|
630
|
+
)}
|
|
620
631
|
<div
|
|
621
632
|
style={{
|
|
622
633
|
display: "grid",
|
|
@@ -627,7 +638,8 @@ function ServiceItemMobile({
|
|
|
627
638
|
position: "relative",
|
|
628
639
|
zIndex:
|
|
629
640
|
hasOfferText ||
|
|
630
|
-
(serviceItem?.is_dp_enabled &&
|
|
641
|
+
(serviceItem?.is_dp_enabled &&
|
|
642
|
+
serviceItem?.dp_discount_percents) ||
|
|
631
643
|
(isNewUiEnabled && serviceItem?.ui_type === 2)
|
|
632
644
|
? -2
|
|
633
645
|
: -1,
|
|
@@ -638,15 +650,14 @@ function ServiceItemMobile({
|
|
|
638
650
|
overflow: "hidden",
|
|
639
651
|
minHeight: 0,
|
|
640
652
|
position:
|
|
641
|
-
hasOfferText ||
|
|
642
|
-
isNewUiEnabled ||
|
|
643
|
-
serviceItem?.is_dp_enabled
|
|
653
|
+
hasOfferText || isNewUiEnabled || serviceItem?.is_dp_enabled
|
|
644
654
|
? "relative"
|
|
645
655
|
: undefined,
|
|
646
656
|
zIndex:
|
|
647
657
|
serviceItem?.offer_text ||
|
|
648
658
|
(isNewUiEnabled && serviceItem?.ui_type === 2) ||
|
|
649
|
-
(serviceItem?.is_dp_enabled &&
|
|
659
|
+
(serviceItem?.is_dp_enabled &&
|
|
660
|
+
serviceItem?.dp_discount_percents)
|
|
650
661
|
? -3
|
|
651
662
|
: undefined,
|
|
652
663
|
marginTop: hasOfferText ? "-15px" : "-10px",
|
package/src/ui/OfferBanner.tsx
CHANGED
|
@@ -228,7 +228,7 @@ const OfferBanner: React.FC<OfferBannerProps> = ({
|
|
|
228
228
|
const isDiscountBelow20 =
|
|
229
229
|
(serviceItem as any)?.discount_value > 0 &&
|
|
230
230
|
(serviceItem as any)?.discount_value < 20;
|
|
231
|
-
const offerText =
|
|
231
|
+
const offerText = serviceItem?.offer_text || "";
|
|
232
232
|
|
|
233
233
|
const isLegacyOffer =
|
|
234
234
|
!!offerText &&
|