kupos-ui-components-lib 10.0.1 → 10.0.2
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/PaymentSideBar/PaymentSideBarMobile.js +1 -1
- package/dist/styles.css +0 -3
- package/dist/ui/FeatureServiceUI/FeatureServiceUi.js +3 -3
- package/dist/utils/CommonService.d.ts +1 -0
- package/dist/utils/CommonService.js +7 -0
- package/package.json +1 -1
- package/src/components/PaymentSideBar/PaymentSideBarMobile.tsx +1 -1
- package/src/ui/FeatureServiceUI/FeatureServiceUi.tsx +11 -3
- package/src/utils/CommonService.ts +9 -0
|
@@ -226,7 +226,7 @@ const PaymentSideBarMobile = ({ serviceNameOnward, serviceNameReturn, metaData,
|
|
|
226
226
|
walletMoney ? (React.createElement(PaymentItem, { label: walletLabel, amount: CommonService.currency(walletMoney, currencySign), className: "text-[14px]", customStyle: { color: "var(--secondary-color)" }, currency: "" })) : null,
|
|
227
227
|
virtualMoney ? (React.createElement(PaymentItem, { label: React.createElement("span", { className: "secondary-text", style: { color: "var(--secondary-color)" } }, `${creditosLabel}(${virtualLimit}%)`), amount: CommonService.currency(virtualMoney, currencySign), customStyle: { color: "var(--secondary-color)" }, className: "text-[14px]", currency: "" })) : null,
|
|
228
228
|
showUsd ? (React.createElement(PaymentItem, { label: React.createElement("span", { className: "primary-text" }, translation === null || translation === void 0 ? void 0 : translation.showUsd), amount: CommonService.currency(isAgency ? netFareInUsd + agencyFee : netFareInUsd, currencySign), currency: "USD", customStyle: { color: "var(--primary-color)" }, className: "text-[14px]" })) : null)),
|
|
229
|
-
React.createElement("div", { className: ` text-[#fff] p-[10px_15px] text-left w-full flex items-center absolute -bottom-[
|
|
229
|
+
React.createElement("div", { className: ` text-[#fff] p-[10px_15px] text-left w-full flex items-center absolute -bottom-[9%] pt-[50px] z-1 rounded-b-[14px] text-[14px]`, style: { backgroundColor: colors === null || colors === void 0 ? void 0 : colors.bottomStripColor } },
|
|
230
230
|
React.createElement("div", { className: "flex justify-between items-center w-full text-[#fff]" },
|
|
231
231
|
React.createElement("div", { className: "bold-text" }, "Total"),
|
|
232
232
|
React.createElement("div", { className: "bold-text text-[14px] text-[#fff]", style: {
|
package/dist/styles.css
CHANGED
|
@@ -333,7 +333,7 @@ const FeatureServiceUi = ({ serviceItem, showTopLabel, getAnimationIcon, cityOri
|
|
|
333
333
|
displaySavingsPercent,
|
|
334
334
|
"% OFF"),
|
|
335
335
|
React.createElement("span", { className: "text-[13.33px] font-normal leading-[20px] text-[#9f9f9f] relative", style: { position: "relative" } },
|
|
336
|
-
|
|
336
|
+
commonService.currencyRounded(displayOriginalPrice * ticketQuantity),
|
|
337
337
|
React.createElement("span", { style: {
|
|
338
338
|
position: "absolute",
|
|
339
339
|
left: "-2px",
|
|
@@ -344,7 +344,7 @@ const FeatureServiceUi = ({ serviceItem, showTopLabel, getAnimationIcon, cityOri
|
|
|
344
344
|
transform: "rotate(-10deg)",
|
|
345
345
|
transformOrigin: "center",
|
|
346
346
|
} })),
|
|
347
|
-
React.createElement("span", { className: "text-white bold-text text-[28px] leading-none" },
|
|
347
|
+
React.createElement("span", { className: "text-white bold-text text-[28px] leading-none" }, commonService.currencyRounded(displayFinalPrice * ticketQuantity))),
|
|
348
348
|
React.createElement("div", { className: "mt-[4px] flex flex-col items-center gap-[8px]" },
|
|
349
349
|
React.createElement("span", { className: "text-[12px] text-white" }, "\u00BFCu\u00E1ntos pasajes quieres?"),
|
|
350
350
|
React.createElement("div", { className: "flex w-full items-center justify-between rounded-[16px] ", style: {
|
|
@@ -378,7 +378,7 @@ const FeatureServiceUi = ({ serviceItem, showTopLabel, getAnimationIcon, cityOri
|
|
|
378
378
|
normal.style.display = "none";
|
|
379
379
|
if (loading)
|
|
380
380
|
loading.style.display = "flex";
|
|
381
|
-
onBookButtonPress === null || onBookButtonPress === void 0 ? void 0 : onBookButtonPress(ticketQuantity, serviceItem);
|
|
381
|
+
onBookButtonPress === null || onBookButtonPress === void 0 ? void 0 : onBookButtonPress(ticketQuantity, serviceItem, servicesInActiveSlot);
|
|
382
382
|
};
|
|
383
383
|
}, className: "flex items-center gap-[6px] px-[20px] py-[10px] rounded-[16px] text-white bold-text text-[13px] mt-[4px] justify-center border-none cursor-pointer text-center", style: {
|
|
384
384
|
backgroundColor: "#FF5C60",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
declare const commonService: {
|
|
2
2
|
currency(amount: number, currencySign?: string): string;
|
|
3
|
+
currencyRounded(amount: number, currencySign?: string): string;
|
|
3
4
|
discountedCurrency(amount: number, currencySign?: string): string;
|
|
4
5
|
copyObject: (ob: any) => any;
|
|
5
6
|
getServiceTypeLabelForFilters: (service_type: any) => "Tipo de servicio" | "Punto de embarque" | "Tipo de asiento" | "SERVICIOS" | "";
|
|
@@ -6,6 +6,13 @@ const commonService = {
|
|
|
6
6
|
const sign = currencySign || "$";
|
|
7
7
|
return sign + formattedAmount;
|
|
8
8
|
},
|
|
9
|
+
currencyRounded(amount, currencySign) {
|
|
10
|
+
const formattedAmount = Math.round(amount)
|
|
11
|
+
.toString()
|
|
12
|
+
.replace(/\B(?=(\d{3})+(?!\d))/g, ".");
|
|
13
|
+
const sign = currencySign || "$";
|
|
14
|
+
return sign + formattedAmount;
|
|
15
|
+
},
|
|
9
16
|
discountedCurrency(amount, currencySign) {
|
|
10
17
|
const formattedAmount = Math.trunc(amount)
|
|
11
18
|
.toString()
|
package/package.json
CHANGED
|
@@ -644,7 +644,7 @@ const PaymentSideBarMobile: React.FC<PaymentSideBarProps> = ({
|
|
|
644
644
|
</div>
|
|
645
645
|
</div>
|
|
646
646
|
<div
|
|
647
|
-
className={` text-[#fff] p-[10px_15px] text-left w-full flex items-center absolute -bottom-[
|
|
647
|
+
className={` text-[#fff] p-[10px_15px] text-left w-full flex items-center absolute -bottom-[9%] pt-[50px] z-1 rounded-b-[14px] text-[14px]`}
|
|
648
648
|
style={{ backgroundColor: colors?.bottomStripColor }}
|
|
649
649
|
>
|
|
650
650
|
<div className="flex justify-between items-center w-full text-[#fff]">
|
|
@@ -557,7 +557,9 @@ const FeatureServiceUi = ({
|
|
|
557
557
|
className="text-[13.33px] font-normal leading-[20px] text-[#9f9f9f] relative"
|
|
558
558
|
style={{ position: "relative" }}
|
|
559
559
|
>
|
|
560
|
-
{
|
|
560
|
+
{commonService.currencyRounded(
|
|
561
|
+
displayOriginalPrice * ticketQuantity,
|
|
562
|
+
)}
|
|
561
563
|
<span
|
|
562
564
|
style={{
|
|
563
565
|
position: "absolute",
|
|
@@ -574,7 +576,9 @@ const FeatureServiceUi = ({
|
|
|
574
576
|
/>
|
|
575
577
|
</span>
|
|
576
578
|
<span className="text-white bold-text text-[28px] leading-none">
|
|
577
|
-
{
|
|
579
|
+
{commonService.currencyRounded(
|
|
580
|
+
displayFinalPrice * ticketQuantity,
|
|
581
|
+
)}
|
|
578
582
|
</span>
|
|
579
583
|
</div>
|
|
580
584
|
|
|
@@ -644,7 +648,11 @@ const FeatureServiceUi = ({
|
|
|
644
648
|
) as HTMLElement | null;
|
|
645
649
|
if (normal) normal.style.display = "none";
|
|
646
650
|
if (loading) loading.style.display = "flex";
|
|
647
|
-
onBookButtonPress?.(
|
|
651
|
+
onBookButtonPress?.(
|
|
652
|
+
ticketQuantity,
|
|
653
|
+
serviceItem,
|
|
654
|
+
servicesInActiveSlot,
|
|
655
|
+
);
|
|
648
656
|
};
|
|
649
657
|
}}
|
|
650
658
|
className="flex items-center gap-[6px] px-[20px] py-[10px] rounded-[16px] text-white bold-text text-[13px] mt-[4px] justify-center border-none cursor-pointer text-center"
|
|
@@ -8,6 +8,15 @@ const commonService = {
|
|
|
8
8
|
return sign + formattedAmount;
|
|
9
9
|
},
|
|
10
10
|
|
|
11
|
+
currencyRounded(amount: number, currencySign?: string) {
|
|
12
|
+
const formattedAmount = Math.round(amount)
|
|
13
|
+
.toString()
|
|
14
|
+
.replace(/\B(?=(\d{3})+(?!\d))/g, ".");
|
|
15
|
+
|
|
16
|
+
const sign = currencySign || "$";
|
|
17
|
+
return sign + formattedAmount;
|
|
18
|
+
},
|
|
19
|
+
|
|
11
20
|
discountedCurrency(amount: number, currencySign?: string) {
|
|
12
21
|
const formattedAmount = Math.trunc(amount)
|
|
13
22
|
.toString()
|