paymob-pixel-alpha 1.1.82 → 1.1.83
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/main.js +10 -2
- package/package.json +1 -1
package/main.js
CHANGED
|
@@ -18657,6 +18657,14 @@ const CardElement = /*#__PURE__*/(0,react.forwardRef)(({
|
|
|
18657
18657
|
}
|
|
18658
18658
|
}
|
|
18659
18659
|
};
|
|
18660
|
+
const parseAmount = value => {
|
|
18661
|
+
if (!value || !(value != null && value.trim())) return undefined;
|
|
18662
|
+
const parsed = Number(value);
|
|
18663
|
+
return Number.isNaN(parsed) ? undefined : parsed;
|
|
18664
|
+
};
|
|
18665
|
+
const transactionAmount = parseAmount(totalAmount);
|
|
18666
|
+
const orderAmount = parseAmount(`${amount}`);
|
|
18667
|
+
const shouldShowStrikethrough = transactionAmount !== undefined && orderAmount !== undefined && transactionAmount < orderAmount;
|
|
18660
18668
|
const showOrderDetails = discountedAmount || showFeesDetails && feesAmount || isInstantRefundActive && isInstantRefundChecked && instantRefundAmount || isEppEnabled && selectedInstallmentPlan || tenure;
|
|
18661
18669
|
const orderDetailsContent = showOrderDetails ? /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
18662
18670
|
className: "flex flex-col gap-3 text-sm leading-4",
|
|
@@ -18961,7 +18969,7 @@ const CardElement = /*#__PURE__*/(0,react.forwardRef)(({
|
|
|
18961
18969
|
fontFamily: currencyFontFamily
|
|
18962
18970
|
},
|
|
18963
18971
|
children: displayCurrency
|
|
18964
|
-
}), ' ', totalAmount || formattedAmount, totalAmount && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
18972
|
+
}), ' ', totalAmount || formattedAmount, totalAmount && shouldShowStrikethrough && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
18965
18973
|
className: "opacity-50 ml-2 text-white text-sm font-semibold leading-6 tracking-[0.16px]",
|
|
18966
18974
|
style: {
|
|
18967
18975
|
textDecoration: 'line-through'
|
|
@@ -19080,7 +19088,7 @@ const CardElement = /*#__PURE__*/(0,react.forwardRef)(({
|
|
|
19080
19088
|
fontFamily: currencyFontFamily
|
|
19081
19089
|
},
|
|
19082
19090
|
children: displayCurrency
|
|
19083
|
-
}), ' ', totalAmount || formattedAmount, totalAmount && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
19091
|
+
}), ' ', totalAmount || formattedAmount, totalAmount && shouldShowStrikethrough && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
19084
19092
|
className: "opacity-50 ml-2 text-white text-sm font-semibold leading-6 tracking-[0.16px]",
|
|
19085
19093
|
style: {
|
|
19086
19094
|
textDecoration: 'line-through'
|