kupos-ui-components-lib 9.0.6 → 9.0.8
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 +32 -69
- package/dist/styles.css +13 -3
- package/dist/ui/BottomAmenities/BottomAmenities.js +3 -2
- package/dist/ui/DateTimeSection/DateTimeSection.d.ts +28 -0
- package/dist/ui/DateTimeSection/DateTimeSection.js +58 -0
- package/dist/ui/DirectoBlock.d.ts +8 -0
- package/dist/ui/DirectoBlock.js +11 -0
- package/dist/ui/ExpendedDropDown/ExpandedDropdown.d.ts +1 -0
- package/dist/ui/ExpendedDropDown/ExpandedDropdown.js +28 -18
- package/dist/ui/SeatSection/SeatSection.js +1 -1
- package/dist/ui/TopAmenities/PromoCountdown.d.ts +18 -0
- package/dist/ui/TopAmenities/PromoCountdown.js +55 -0
- package/dist/ui/TopAmenities/TopAmenities.d.ts +4 -1
- package/dist/ui/TopAmenities/TopAmenities.js +31 -4
- package/dist/utils/CommonService.d.ts +1 -1
- package/package.json +2 -1
- package/src/components/ServiceItem/ServiceItemDesktop.tsx +66 -197
- package/src/ui/BottomAmenities/BottomAmenities.tsx +3 -2
- package/src/ui/DateTimeSection/DateTimeSection.tsx +207 -0
- package/src/ui/DirectoBlock.tsx +31 -0
- package/src/ui/ExpendedDropDown/ExpandedDropdown.tsx +35 -5
- package/src/ui/SeatSection/SeatSection.tsx +1 -1
- package/src/ui/TopAmenities/TopAmenities.tsx +37 -3
|
@@ -9,6 +9,9 @@ interface TopAmenitiesProps {
|
|
|
9
9
|
buttonColor?: string;
|
|
10
10
|
boardingIcon?: React.ReactNode;
|
|
11
11
|
getAnimationIcon: (icon: string) => any;
|
|
12
|
+
countdownSeconds?: number;
|
|
13
|
+
promoText?: string;
|
|
14
|
+
onCountdownEnd?: () => void;
|
|
12
15
|
}
|
|
13
16
|
|
|
14
17
|
function TopAmenities({
|
|
@@ -19,7 +22,36 @@ function TopAmenities({
|
|
|
19
22
|
buttonColor,
|
|
20
23
|
boardingIcon,
|
|
21
24
|
getAnimationIcon,
|
|
25
|
+
countdownSeconds = 0,
|
|
26
|
+
onCountdownEnd,
|
|
22
27
|
}: TopAmenitiesProps): React.ReactElement {
|
|
28
|
+
const pad = (n: number) => String(n).padStart(2, "0");
|
|
29
|
+
|
|
30
|
+
const startCountdown = (el: HTMLSpanElement | null) => {
|
|
31
|
+
if (!el || el.dataset.timerStarted) return;
|
|
32
|
+
el.dataset.timerStarted = "true";
|
|
33
|
+
let remaining = countdownSeconds;
|
|
34
|
+
|
|
35
|
+
const update = () => {
|
|
36
|
+
const hrs = Math.floor(remaining / 3600);
|
|
37
|
+
const mins = Math.floor((remaining % 3600) / 60);
|
|
38
|
+
const secs = remaining % 60;
|
|
39
|
+
el.textContent = `${pad(hrs)}:${pad(mins)}:${pad(secs)}`;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
update();
|
|
43
|
+
const timer = setInterval(() => {
|
|
44
|
+
if (remaining <= 0) {
|
|
45
|
+
clearInterval(timer);
|
|
46
|
+
const promoBar = el.closest("[data-promo-bar]") as HTMLElement;
|
|
47
|
+
if (promoBar) promoBar.style.display = "none";
|
|
48
|
+
if (onCountdownEnd) onCountdownEnd();
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
remaining--;
|
|
52
|
+
update();
|
|
53
|
+
}, 1000);
|
|
54
|
+
};
|
|
23
55
|
return (
|
|
24
56
|
<div
|
|
25
57
|
style={{
|
|
@@ -31,6 +63,7 @@ function TopAmenities({
|
|
|
31
63
|
>
|
|
32
64
|
{/* {showPromo && ( */}
|
|
33
65
|
<div
|
|
66
|
+
data-promo-bar
|
|
34
67
|
style={{
|
|
35
68
|
backgroundColor: priceColor,
|
|
36
69
|
position: "relative",
|
|
@@ -43,8 +76,8 @@ function TopAmenities({
|
|
|
43
76
|
<div style={{ display: "flex", alignItems: "center" }}>
|
|
44
77
|
<LottiePlayer
|
|
45
78
|
animationData={getAnimationIcon("bombAnimation")}
|
|
46
|
-
width="
|
|
47
|
-
height="
|
|
79
|
+
width="16px"
|
|
80
|
+
height="16px"
|
|
48
81
|
/>
|
|
49
82
|
<span
|
|
50
83
|
className="flex items-center py-[10px] pl-[6px] text-white text-[13.33px] z-20"
|
|
@@ -52,7 +85,8 @@ function TopAmenities({
|
|
|
52
85
|
>
|
|
53
86
|
<span className="bold-text">kuponazo 20% </span> | Termina
|
|
54
87
|
en
|
|
55
|
-
<span className="bold-text"
|
|
88
|
+
<span className="bold-text" ref={startCountdown} />
|
|
89
|
+
{/* <span className="bold-text">02:10:30</span> */}
|
|
56
90
|
</span>
|
|
57
91
|
</div>
|
|
58
92
|
</div>
|