@lookiero/checkout 2.2.1 → 2.3.0
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.
|
@@ -8,6 +8,7 @@ interface PricingDto {
|
|
|
8
8
|
readonly pendingToPay: PriceProjection;
|
|
9
9
|
readonly service: ServiceProjection;
|
|
10
10
|
readonly subtotal: PriceProjection;
|
|
11
|
+
readonly paidWithPromocode?: boolean;
|
|
11
12
|
}
|
|
12
13
|
interface ToPricingProjectionFunction {
|
|
13
14
|
(pricingDto: PricingDto): PricingProjection;
|
|
@@ -10,7 +10,6 @@ import { style } from "./Pricing.style";
|
|
|
10
10
|
import { ArrowDown } from "./icons/ArrowDown";
|
|
11
11
|
import { ArrowUp } from "./icons/ArrowUp";
|
|
12
12
|
const { colorGrayscaleS } = theme();
|
|
13
|
-
const PS_SERVICE_FREE_INDICATOR = 100;
|
|
14
13
|
const Row = ({ text, level = 3, children }) => (React.createElement(View, { style: style.row },
|
|
15
14
|
React.createElement(Text, { level: level, action: true, upperCase: true }, text),
|
|
16
15
|
children));
|
|
@@ -29,7 +28,6 @@ const Pricing = ({ pendingToPay, subtotal, balanceDiscount, discount, discountPe
|
|
|
29
28
|
}) || "";
|
|
30
29
|
const creditText = useI18nMessage({ id: I18nMessages.SUMMARY_CREDIT }) || "";
|
|
31
30
|
const feeText = useI18nMessage({ id: I18nMessages.SUMMARY_FEE }) || "";
|
|
32
|
-
const isPSServiceFree = service.discount.amount === PS_SERVICE_FREE_INDICATOR;
|
|
33
31
|
const collapsedStyle = useSpring({ opacitiy: collapsed ? 1 : 0 });
|
|
34
32
|
const notCollapsedStyle = useSpring({ opacitiy: collapsed ? 0 : 1 });
|
|
35
33
|
return (React.createElement(Pressable, { testID: "pricing", onPress: collapsible ? onPress : null },
|
|
@@ -49,7 +47,7 @@ const Pricing = ({ pendingToPay, subtotal, balanceDiscount, discount, discountPe
|
|
|
49
47
|
React.createElement(Price, { price: discount, variant: "subtotal" }))),
|
|
50
48
|
balanceDiscount && balanceDiscount.amount !== 0 && (React.createElement(Row, { text: creditText },
|
|
51
49
|
React.createElement(Price, { price: balanceDiscount, variant: "subtotal" }))),
|
|
52
|
-
React.createElement(Row, { text: feeText },
|
|
50
|
+
React.createElement(Row, { text: feeText }, service.paidWithPromocode ? (React.createElement(Text, { level: 3, action: true, upperCase: true }, freeText)) : (React.createElement(Price, { price: service.finalPrice, variant: "subtotal" }))),
|
|
53
51
|
React.createElement(View, { style: style.divider }),
|
|
54
52
|
React.createElement(Row, { level: 2, text: totalText },
|
|
55
53
|
React.createElement(Price, { price: pendingToPay, variant: "total" })),
|