kupos-ui-components-lib 10.4.3 → 10.4.5
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/ui/OfferBanner.js
CHANGED
|
@@ -57,25 +57,25 @@ const ViewersCount = ({ serviceItem, viewersConfig, getAnimationIcon, }) => {
|
|
|
57
57
|
};
|
|
58
58
|
// ─── Main Component ───────────────────────────────────────────────────────────
|
|
59
59
|
const OfferBanner = ({ offerGradient, isSoldOut, serviceItem, isLoggedIn, showLoginModal, viewersConfig, getAnimationIcon, showLoginOption, isNewUiEnabled, colors, isLinatal, coachKey, isExpand, }) => {
|
|
60
|
-
const isDiscountBelow20 = (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.discount_value) > 0 &&
|
|
60
|
+
const isDiscountBelow20 = (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.discount_value) > 0 &&
|
|
61
|
+
(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.discount_value) < 20;
|
|
61
62
|
const offerText = isDiscountBelow20 ? "" : (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.offer_text) || "";
|
|
62
63
|
const isLegacyOffer = !!offerText &&
|
|
63
64
|
isNewUiEnabled &&
|
|
64
65
|
(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.ui_type) === 1 &&
|
|
65
66
|
!(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_dp_enabled);
|
|
66
|
-
const isDpEnabledWithoutDiscounts = (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_dp_enabled) && hasDpDiscounts(serviceItem);
|
|
67
67
|
const showViewers = (isNewUiEnabled && (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.ui_type) !== 1) ||
|
|
68
68
|
(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_dp_enabled);
|
|
69
69
|
const background = isLegacyOffer ? colors === null || colors === void 0 ? void 0 : colors.bottomStripColor : offerGradient;
|
|
70
70
|
const renderLeftContent = () => {
|
|
71
|
-
|
|
71
|
+
const hasDp = hasDpDiscounts(serviceItem);
|
|
72
|
+
if ((serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_dp_enabled) && !hasDp) {
|
|
72
73
|
return React.createElement(PopularServiceBanner, { getAnimationIcon: getAnimationIcon });
|
|
73
74
|
}
|
|
74
75
|
if (isLegacyOffer) {
|
|
75
76
|
return (React.createElement(LegacyOfferBanner, { offerText: offerText, getAnimationIcon: getAnimationIcon }));
|
|
76
77
|
}
|
|
77
|
-
|
|
78
|
-
if (isNewUiEnabled && (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.ui_type) === 2) {
|
|
78
|
+
if (hasDp || (isNewUiEnabled && (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.ui_type) === 2)) {
|
|
79
79
|
return (React.createElement(NewUiOfferBanner, { offerText: offerText, isLoggedIn: isLoggedIn, showLoginModal: showLoginModal, showLoginOption: showLoginOption, getAnimationIcon: getAnimationIcon, hideRegister: hasDp, isNewUiEnabled: isNewUiEnabled, showLoginButton: serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.show_register_button, ui_type: serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.ui_type }));
|
|
80
80
|
}
|
|
81
81
|
return null;
|
|
@@ -243,10 +243,11 @@ function SeatSectionMobile({ seatTypes: seatTypesData, isSoldOut, isPeru, seatPr
|
|
|
243
243
|
? `${commonService.currency(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.max_discount)} OFF`
|
|
244
244
|
: `${discountValue}% OFF`)),
|
|
245
245
|
React.createElement("span", { className: "min-[420]:text-[13px] text-[12px] leading-[20px] text-[#c2c2c2]" }, "Antes"),
|
|
246
|
-
React.createElement("span", { className: "min-[420]:text-[13px] text-[12px] leading-[20px] text-
|
|
246
|
+
React.createElement("span", { className: "min-[420]:text-[13px] text-[12px] leading-[20px] text-right", style: {
|
|
247
247
|
position: "relative",
|
|
248
248
|
display: "inline-block",
|
|
249
249
|
overflow: "hidden",
|
|
250
|
+
color: discountSeatPriceColor,
|
|
250
251
|
} },
|
|
251
252
|
commonService.currency(discountSeat.originalPrice, currencySign),
|
|
252
253
|
React.createElement("span", { style: {
|
package/package.json
CHANGED
package/src/ui/OfferBanner.tsx
CHANGED
|
@@ -225,7 +225,9 @@ const OfferBanner: React.FC<OfferBannerProps> = ({
|
|
|
225
225
|
coachKey,
|
|
226
226
|
isExpand,
|
|
227
227
|
}) => {
|
|
228
|
-
const isDiscountBelow20 =
|
|
228
|
+
const isDiscountBelow20 =
|
|
229
|
+
(serviceItem as any)?.discount_value > 0 &&
|
|
230
|
+
(serviceItem as any)?.discount_value < 20;
|
|
229
231
|
const offerText = isDiscountBelow20 ? "" : serviceItem?.offer_text || "";
|
|
230
232
|
|
|
231
233
|
const isLegacyOffer =
|
|
@@ -234,9 +236,6 @@ const OfferBanner: React.FC<OfferBannerProps> = ({
|
|
|
234
236
|
serviceItem?.ui_type === 1 &&
|
|
235
237
|
!serviceItem?.is_dp_enabled;
|
|
236
238
|
|
|
237
|
-
const isDpEnabledWithoutDiscounts =
|
|
238
|
-
serviceItem?.is_dp_enabled && hasDpDiscounts(serviceItem);
|
|
239
|
-
|
|
240
239
|
const showViewers =
|
|
241
240
|
(isNewUiEnabled && serviceItem?.ui_type !== 1) ||
|
|
242
241
|
serviceItem?.is_dp_enabled;
|
|
@@ -244,7 +243,9 @@ const OfferBanner: React.FC<OfferBannerProps> = ({
|
|
|
244
243
|
const background = isLegacyOffer ? colors?.bottomStripColor : offerGradient;
|
|
245
244
|
|
|
246
245
|
const renderLeftContent = () => {
|
|
247
|
-
|
|
246
|
+
const hasDp = hasDpDiscounts(serviceItem);
|
|
247
|
+
|
|
248
|
+
if (serviceItem?.is_dp_enabled && !hasDp) {
|
|
248
249
|
return <PopularServiceBanner getAnimationIcon={getAnimationIcon} />;
|
|
249
250
|
}
|
|
250
251
|
|
|
@@ -257,9 +258,7 @@ const OfferBanner: React.FC<OfferBannerProps> = ({
|
|
|
257
258
|
);
|
|
258
259
|
}
|
|
259
260
|
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
if (isNewUiEnabled && serviceItem?.ui_type === 2) {
|
|
261
|
+
if (hasDp || (isNewUiEnabled && serviceItem?.ui_type === 2)) {
|
|
263
262
|
return (
|
|
264
263
|
<NewUiOfferBanner
|
|
265
264
|
offerText={offerText}
|
|
@@ -575,11 +575,12 @@ function SeatSectionMobile({
|
|
|
575
575
|
Antes
|
|
576
576
|
</span>
|
|
577
577
|
<span
|
|
578
|
-
className="min-[420]:text-[13px] text-[12px] leading-[20px] text-
|
|
578
|
+
className="min-[420]:text-[13px] text-[12px] leading-[20px] text-right"
|
|
579
579
|
style={{
|
|
580
580
|
position: "relative",
|
|
581
581
|
display: "inline-block",
|
|
582
582
|
overflow: "hidden",
|
|
583
|
+
color: discountSeatPriceColor,
|
|
583
584
|
}}
|
|
584
585
|
>
|
|
585
586
|
{commonService.currency(
|