kupos-ui-components-lib 9.9.7 → 9.9.9
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 +3 -0
- package/dist/components/ServiceItem/PeruServiceItemDesktop.d.ts +1 -1
- package/dist/components/ServiceItem/PeruServiceItemDesktop.js +156 -176
- package/dist/components/ServiceItem/ServiceItemDesktop.d.ts +1 -1
- package/dist/components/ServiceItem/ServiceItemDesktop.js +28 -12
- package/dist/components/ServiceItem/ServiceItemMobile.d.ts +1 -1
- package/dist/components/ServiceItem/ServiceItemMobile.js +45 -17
- package/dist/components/ServiceItem/mobileTypes.d.ts +48 -0
- package/dist/components/ServiceItem/types.d.ts +27 -1
- package/dist/styles.css +219 -13
- package/dist/ui/ExpendedDropDown/ExpandedDropdown.d.ts +1 -2
- package/dist/ui/ExpendedDropDown/ExpandedDropdown.js +2 -4
- package/dist/ui/FeaturServiceUiMobile/FeatureServiceUiMobile.js +3 -10
- package/dist/ui/OfferBanner.d.ts +2 -0
- package/dist/ui/OfferBanner.js +22 -15
- package/dist/ui/SeatSection/SeatSection.js +3 -3
- package/dist/utils/CommonService.d.ts +3 -0
- package/dist/utils/CommonService.js +18 -1
- package/package.json +1 -1
- package/src/KuposUIComponent.tsx +3 -0
- package/src/assets/images/anims/service_list/flame_anim.json +1 -0
- package/src/assets/images/anims/service_list/thunder_icon.json +1 -0
- package/src/assets/images/anims/service_list/users_anim.json +1 -0
- package/src/components/ServiceItem/PeruServiceItemDesktop.tsx +404 -277
- package/src/components/ServiceItem/ServiceItemDesktop.tsx +71 -8
- package/src/components/ServiceItem/ServiceItemMobile.tsx +374 -271
- package/src/components/ServiceItem/mobileTypes.ts +48 -0
- package/src/components/ServiceItem/types.ts +32 -1
- package/src/styles.css +15 -0
- package/src/ui/ExpendedDropDown/ExpandedDropdown.tsx +2 -4
- package/src/ui/FeaturServiceUiMobile/FeatureServiceUiMobile.tsx +575 -0
- package/src/ui/FeatureServiceUI/FeatureServiceUi.tsx +634 -0
- package/src/ui/OfferBanner.tsx +71 -43
- package/src/ui/SeatSection/SeatSection.tsx +3 -3
- package/src/utils/CommonService.ts +26 -1
package/src/ui/OfferBanner.tsx
CHANGED
|
@@ -19,6 +19,8 @@ interface OfferBannerProps {
|
|
|
19
19
|
viewersConfig: ServiceItemProps["viewersConfig"];
|
|
20
20
|
getAnimationIcon: (name: string) => any;
|
|
21
21
|
showLoginOption?: boolean;
|
|
22
|
+
isNewUiEnabled?: boolean;
|
|
23
|
+
colors: any;
|
|
22
24
|
}
|
|
23
25
|
|
|
24
26
|
const OfferBanner: React.FC<OfferBannerProps> = ({
|
|
@@ -31,12 +33,17 @@ const OfferBanner: React.FC<OfferBannerProps> = ({
|
|
|
31
33
|
viewersConfig,
|
|
32
34
|
getAnimationIcon,
|
|
33
35
|
showLoginOption,
|
|
36
|
+
isNewUiEnabled,
|
|
37
|
+
colors,
|
|
34
38
|
}) => {
|
|
35
39
|
return (
|
|
36
40
|
<div
|
|
37
|
-
className="text-white p-[
|
|
41
|
+
className="text-white p-[15px_15px] text-left w-full flex items-center absolute -bottom-[44px] pt-[50px] rounded-b-[14px] text-[14px] mt-[10px]"
|
|
38
42
|
style={{
|
|
39
|
-
background:
|
|
43
|
+
background:
|
|
44
|
+
serviceItem?.offer_text && !isNewUiEnabled
|
|
45
|
+
? colors?.bottomStripColor
|
|
46
|
+
: offerGradient,
|
|
40
47
|
opacity: isSoldOut ? 0.5 : 1,
|
|
41
48
|
// zIndex: 0,
|
|
42
49
|
}}
|
|
@@ -56,7 +63,7 @@ const OfferBanner: React.FC<OfferBannerProps> = ({
|
|
|
56
63
|
{/* starAnimation */}
|
|
57
64
|
<span>Servicio popular entre los usuarios</span>
|
|
58
65
|
</div>
|
|
59
|
-
) : (
|
|
66
|
+
) : isNewUiEnabled && serviceItem?.offer_text ? (
|
|
60
67
|
<div className="flex items-center">
|
|
61
68
|
<LottiePlayer
|
|
62
69
|
animationData={getAnimationIcon("bombAnimation")}
|
|
@@ -73,18 +80,14 @@ const OfferBanner: React.FC<OfferBannerProps> = ({
|
|
|
73
80
|
{(serviceItem?.offer_text || "").length > 30
|
|
74
81
|
? (serviceItem?.offer_text || "").slice(0, 30) + "..."
|
|
75
82
|
: serviceItem?.offer_text || ""}{" "}
|
|
76
|
-
{isLoggedIn && showLoginOption ? null :
|
|
77
|
-
serviceItem?.dp_discount_percents ?? {},
|
|
78
|
-
).length > 0 ||
|
|
79
|
-
(serviceItem?.dp_discounted_seats ?? []).length >
|
|
80
|
-
0 ? null : (
|
|
83
|
+
{isLoggedIn && showLoginOption ? null : (
|
|
81
84
|
<span onClick={showLoginModal} className="cursor-pointer">
|
|
82
85
|
- registro
|
|
83
86
|
</span>
|
|
84
87
|
)}{" "}
|
|
85
88
|
|
|
86
89
|
</span>{" "}
|
|
87
|
-
{serviceItem?.offer_text ? "|
|
|
90
|
+
{serviceItem?.offer_text ? "|" : ""}
|
|
88
91
|
Termina en
|
|
89
92
|
<span
|
|
90
93
|
className="bold-text text-end"
|
|
@@ -96,45 +99,70 @@ const OfferBanner: React.FC<OfferBannerProps> = ({
|
|
|
96
99
|
/>
|
|
97
100
|
</div>
|
|
98
101
|
</div>
|
|
102
|
+
) : (
|
|
103
|
+
serviceItem?.offer_text &&
|
|
104
|
+
!isNewUiEnabled && (
|
|
105
|
+
<div className="flex items-center">
|
|
106
|
+
<LottiePlayer
|
|
107
|
+
animationData={getAnimationIcon("promoAnim")}
|
|
108
|
+
width="18px"
|
|
109
|
+
height="18px"
|
|
110
|
+
/>
|
|
111
|
+
<div className="flex items-center mt-[2px]">
|
|
112
|
+
<span
|
|
113
|
+
className="bold-text"
|
|
114
|
+
style={{
|
|
115
|
+
marginLeft: serviceItem?.offer_text ? "6px" : "3px",
|
|
116
|
+
}}
|
|
117
|
+
>
|
|
118
|
+
{serviceItem?.offer_text || ""}
|
|
119
|
+
</span>{" "}
|
|
120
|
+
</div>
|
|
121
|
+
</div>
|
|
122
|
+
)
|
|
99
123
|
)}
|
|
100
124
|
</div>
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
125
|
+
{(isNewUiEnabled || serviceItem?.is_dp_enabled) && (
|
|
126
|
+
<div className="flex items-center">
|
|
127
|
+
{/* {renderIcon("personIcon", "16px")} */}
|
|
128
|
+
<LottiePlayer
|
|
129
|
+
animationData={getAnimationIcon("dotAnimation")}
|
|
130
|
+
width="12px"
|
|
131
|
+
height="12px"
|
|
132
|
+
/>
|
|
108
133
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
+
<span className="ml-[6px]">
|
|
135
|
+
<span
|
|
136
|
+
className="bold-text"
|
|
137
|
+
ref={(node) =>
|
|
138
|
+
CommonService.startViewerCount(node, viewersConfig)
|
|
139
|
+
}
|
|
140
|
+
style={{ fontVariantNumeric: "tabular-nums" }}
|
|
141
|
+
/>{" "}
|
|
142
|
+
{/* <span className="bold-text">personas</span>{" "} */}
|
|
143
|
+
<span>
|
|
144
|
+
{" "}
|
|
145
|
+
{viewersConfig?.label || " viendo"} |{" "}
|
|
146
|
+
<span className="">
|
|
147
|
+
{serviceItem?.is_dp_enabled &&
|
|
148
|
+
Object.keys(serviceItem?.dp_discount_percents ?? {})
|
|
149
|
+
.length === 0 &&
|
|
150
|
+
(serviceItem?.dp_discounted_seats ?? []).length === 0
|
|
151
|
+
? null
|
|
152
|
+
: "Quedan pocos • "}
|
|
153
|
+
<span
|
|
154
|
+
className="bold-text"
|
|
155
|
+
ref={(node) =>
|
|
156
|
+
CommonService.startComprandoCount(node, 4, 16)
|
|
157
|
+
}
|
|
158
|
+
style={{ fontVariantNumeric: "tabular-nums" }}
|
|
159
|
+
/>{" "}
|
|
160
|
+
comprando
|
|
161
|
+
</span>
|
|
134
162
|
</span>
|
|
135
163
|
</span>
|
|
136
|
-
</
|
|
137
|
-
|
|
164
|
+
</div>
|
|
165
|
+
)}
|
|
138
166
|
</div>
|
|
139
167
|
</div>
|
|
140
168
|
);
|
|
@@ -342,7 +342,7 @@ function SeatSection({
|
|
|
342
342
|
{!isNaN(Number(dpDiscountPercent)) &&
|
|
343
343
|
Number(dpDiscountPercent) > 0 && (
|
|
344
344
|
<span
|
|
345
|
-
className=
|
|
345
|
+
className={`rounded-[100px] ${discountSeatPriceColor} bg-[#ff5964] px-[6px] text-[12px] bold-text leading-[20px] text-white`}
|
|
346
346
|
style={{
|
|
347
347
|
animation: "pulse-zoom 2s ease-in-out infinite",
|
|
348
348
|
whiteSpace: "nowrap",
|
|
@@ -384,7 +384,7 @@ function SeatSection({
|
|
|
384
384
|
>
|
|
385
385
|
<div
|
|
386
386
|
className="absolute"
|
|
387
|
-
style={{ left: isPeru ? "-
|
|
387
|
+
style={{ left: isPeru ? "-1px" : "-19px", bottom: "1px" }}
|
|
388
388
|
>
|
|
389
389
|
{renderIcon("fireIcon", "16px")}
|
|
390
390
|
</div>
|
|
@@ -541,7 +541,7 @@ function SeatSection({
|
|
|
541
541
|
<div
|
|
542
542
|
className="absolute"
|
|
543
543
|
style={{
|
|
544
|
-
left: isPeru ? "-
|
|
544
|
+
left: isPeru ? "-1px" : "-18px",
|
|
545
545
|
bottom: "1px",
|
|
546
546
|
}}
|
|
547
547
|
>
|
|
@@ -296,6 +296,9 @@ const commonService = {
|
|
|
296
296
|
discount_type?: string;
|
|
297
297
|
discount_value?: number;
|
|
298
298
|
max_discount?: number;
|
|
299
|
+
discounts?: Array<{
|
|
300
|
+
new_ui_enabled?: boolean;
|
|
301
|
+
}>;
|
|
299
302
|
},
|
|
300
303
|
): { originalPrice: number; discountedPrice: number } => {
|
|
301
304
|
const price =
|
|
@@ -308,6 +311,16 @@ const commonService = {
|
|
|
308
311
|
}
|
|
309
312
|
|
|
310
313
|
const { discount_type, discount_value, max_discount } = serviceItem;
|
|
314
|
+
// Check if there's a discount with new_ui_enabled = true
|
|
315
|
+
const newUiEnabled = serviceItem.discounts?.some(
|
|
316
|
+
(d) => d.new_ui_enabled === true
|
|
317
|
+
);
|
|
318
|
+
|
|
319
|
+
|
|
320
|
+
// Only apply discount if new_ui_enabled is true OR if regular discount exists
|
|
321
|
+
if (!newUiEnabled && (!discount_type || discount_value == null)) {
|
|
322
|
+
return { originalPrice: price, discountedPrice: price };
|
|
323
|
+
}
|
|
311
324
|
|
|
312
325
|
const fixedDiscount =
|
|
313
326
|
discount_type === "fixed" && discount_value != null ? discount_value : 0;
|
|
@@ -335,10 +348,15 @@ const commonService = {
|
|
|
335
348
|
) => {
|
|
336
349
|
if (!node || !viewersConfig) return;
|
|
337
350
|
|
|
351
|
+
const { min, max, interval = 5000 } = viewersConfig;
|
|
352
|
+
const configKey = `${min}-${max}-${interval}`;
|
|
353
|
+
if (node.dataset.viewerId && node.dataset.viewerConfig === configKey) {
|
|
354
|
+
return;
|
|
355
|
+
}
|
|
356
|
+
|
|
338
357
|
const prevId = node.dataset.viewerId;
|
|
339
358
|
if (prevId) clearInterval(Number(prevId));
|
|
340
359
|
|
|
341
|
-
const { min, max, interval = 5000 } = viewersConfig;
|
|
342
360
|
const clamp = (v: number) => Math.min(max, Math.max(min, v));
|
|
343
361
|
const initialValue = Math.floor(Math.random() * (max - min + 1)) + min;
|
|
344
362
|
|
|
@@ -353,6 +371,7 @@ const commonService = {
|
|
|
353
371
|
}, interval);
|
|
354
372
|
|
|
355
373
|
node.dataset.viewerId = String(id);
|
|
374
|
+
node.dataset.viewerConfig = configKey;
|
|
356
375
|
},
|
|
357
376
|
|
|
358
377
|
startCountdown: (
|
|
@@ -394,6 +413,11 @@ const commonService = {
|
|
|
394
413
|
) => {
|
|
395
414
|
if (!node) return;
|
|
396
415
|
|
|
416
|
+
const configKey = `${min}-${max}`;
|
|
417
|
+
if (node.dataset.comprandoId && node.dataset.comprandoConfig === configKey) {
|
|
418
|
+
return;
|
|
419
|
+
}
|
|
420
|
+
|
|
397
421
|
const prevId = node.dataset.comprandoId;
|
|
398
422
|
if (prevId) clearInterval(Number(prevId));
|
|
399
423
|
|
|
@@ -414,6 +438,7 @@ const commonService = {
|
|
|
414
438
|
}, 5000); // Update every 5 seconds
|
|
415
439
|
|
|
416
440
|
node.dataset.comprandoId = String(id);
|
|
441
|
+
node.dataset.comprandoConfig = configKey;
|
|
417
442
|
},
|
|
418
443
|
};
|
|
419
444
|
|