@lookiero/checkout 4.0.0-beta.1 → 4.0.0-beta.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.
@@ -1,4 +1,3 @@
1
- import { useIntl } from "@lookiero/i18n-react";
2
1
  import { QueryStatus } from "@lookiero/messaging-react";
3
2
  import { PaymentFlow } from "@lookiero/payments-front";
4
3
  import React, { useCallback, useEffect, useRef, useState } from "react";
@@ -33,8 +32,6 @@ const CheckoutPaymentModal = ({ customerId, country, isFirstOrder, orderNumber,
33
32
  }, [getAuthToken]);
34
33
  const basePath = useBasePath();
35
34
  const navigate = useNavigate();
36
- const intl = useIntl();
37
- const translateNumber = useCallback((value) => intl.formatNumber(value.amount / 100, { style: "currency", currency: value.currency }), [intl]);
38
35
  const trackCheckout = useTrackCheckout({
39
36
  checkoutId: checkout?.id,
40
37
  country,
@@ -45,8 +42,7 @@ const CheckoutPaymentModal = ({ customerId, country, isFirstOrder, orderNumber,
45
42
  const checkoutItemsKept = checkout?.items.filter((checkoutItem) => checkoutItem.status === CheckoutItemStatus.KEPT || checkoutItem.status === CheckoutItemStatus.REPLACED);
46
43
  const checkoutItems = checkoutItemsKept?.length || 0;
47
44
  const checkoutItemId = checkout?.items.map((checkoutItem) => checkoutItem.id) || [];
48
- const pendingToPay = pricing?.pendingToPay;
49
- const checkoutValue = translateNumber(pendingToPay);
45
+ const checkoutValue = pricing?.pendingToPay.amount / 100;
50
46
  const productVariantId = checkoutItemsKept?.map(({ productVariant }) => productVariant.id) || [];
51
47
  const sizeChange = checkoutItemsKept?.filter(({ replacedFor }) => Boolean(replacedFor)).map(({ id }) => id) || [];
52
48
  trackCheckout({
@@ -68,7 +64,6 @@ const CheckoutPaymentModal = ({ customerId, country, isFirstOrder, orderNumber,
68
64
  orderNumber,
69
65
  pricing?.pendingToPay,
70
66
  trackCheckout,
71
- translateNumber,
72
67
  ]);
73
68
  const [submitCheckout] = useSubmitCheckout({
74
69
  checkoutId: checkout?.id,
@@ -6,7 +6,7 @@ interface TrackCheckoutFunctionArgs {
6
6
  readonly checkoutItems: number;
7
7
  readonly productVariantId: string[];
8
8
  readonly checkoutItemId: string[];
9
- readonly checkoutValue: string;
9
+ readonly checkoutValue: number;
10
10
  readonly sizeChange: string[];
11
11
  readonly isFirstOrder: boolean;
12
12
  }
@@ -90,7 +90,7 @@ interface CheckoutTrackingEvent extends BaseTrackingEvent {
90
90
  readonly checkoutItems: number;
91
91
  readonly productVariantId: string[];
92
92
  readonly checkoutItemId: string[];
93
- readonly checkoutValue: string;
93
+ readonly checkoutValue: number;
94
94
  readonly sizeChange: string[];
95
95
  readonly isFirstOrder: boolean;
96
96
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lookiero/checkout",
3
- "version": "4.0.0-beta.1",
3
+ "version": "4.0.0-beta.2",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [