@lookiero/checkout 10.0.0-beta.4 → 10.0.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.
Files changed (82) hide show
  1. package/dist/fake-dependencies/@lookiero/payments-front/index.d.ts +6 -8
  2. package/dist/fake-dependencies/@lookiero/payments-front/index.js +4 -7
  3. package/dist/index.d.ts +4 -3
  4. package/dist/src/ExpoRoot.js +13 -17
  5. package/dist/src/infrastructure/domain/checkoutBooking/react/useBlockCheckoutBooking.d.ts +1 -1
  6. package/dist/src/infrastructure/domain/checkoutBooking/react/useBlockCheckoutBooking.js +0 -2
  7. package/dist/src/infrastructure/projection/pricing/react/useViewPricingByCheckoutId.d.ts +1 -1
  8. package/dist/src/infrastructure/projection/pricing/react/useViewPricingByCheckoutId.js +1 -2
  9. package/dist/src/infrastructure/tracking/tracking.d.ts +2 -2
  10. package/dist/src/infrastructure/tracking/useTrackCheckout.d.ts +17 -10
  11. package/dist/src/infrastructure/tracking/useTrackCheckout.js +12 -27
  12. package/dist/src/infrastructure/ui/Root.d.ts +9 -7
  13. package/dist/src/infrastructure/ui/Root.js +3 -2
  14. package/dist/src/infrastructure/ui/hooks/usePaymentInstrumentEvents.d.ts +2 -3
  15. package/dist/src/infrastructure/ui/hooks/usePaymentInstrumentEvents.js +26 -17
  16. package/dist/src/infrastructure/ui/hooks/useStaticInfo.d.ts +3 -0
  17. package/dist/src/infrastructure/ui/hooks/useStaticInfo.js +7 -2
  18. package/dist/src/infrastructure/ui/i18n/i18n.d.ts +0 -1
  19. package/dist/src/infrastructure/ui/i18n/i18n.js +0 -1
  20. package/dist/src/infrastructure/ui/routing/CheckoutMiddleware.js +12 -1
  21. package/dist/src/infrastructure/ui/routing/Routing.d.ts +7 -5
  22. package/dist/src/infrastructure/ui/routing/Routing.js +11 -3
  23. package/dist/src/infrastructure/ui/routing/routes.d.ts +1 -0
  24. package/dist/src/infrastructure/ui/routing/routes.js +1 -0
  25. package/dist/src/infrastructure/ui/views/App.js +6 -5
  26. package/dist/src/infrastructure/ui/views/checkout/Checkout.d.ts +2 -7
  27. package/dist/src/infrastructure/ui/views/checkout/Checkout.js +9 -20
  28. package/dist/src/infrastructure/ui/views/checkout/Checkout.style.d.ts +0 -3
  29. package/dist/src/infrastructure/ui/views/checkout/Checkout.style.js +0 -3
  30. package/dist/src/infrastructure/ui/views/checkout/components/checkoutPaymentModal/CheckoutPaymentModal.js +1 -3
  31. package/dist/src/infrastructure/ui/views/checkout/components/paymentInstrument/PaymentInstrument.js +7 -7
  32. package/dist/src/infrastructure/ui/views/summary/Summary.js +1 -2
  33. package/dist/src/projection/customer/customer.d.ts +0 -2
  34. package/dist/src/projection/order/order.d.ts +1 -1
  35. package/dist/src/projection/subscription/subscription.d.ts +1 -1
  36. package/dist/src/version.d.ts +1 -1
  37. package/dist/src/version.js +1 -1
  38. package/fake-dependencies/@lookiero/payments-front/index.tsx +9 -32
  39. package/index.ts +4 -10
  40. package/package.json +4 -3
  41. package/src/ExpoRoot.tsx +37 -42
  42. package/src/infrastructure/domain/checkoutBooking/react/useBlockCheckoutBooking.ts +1 -4
  43. package/src/infrastructure/projection/pricing/react/useViewPricingByCheckoutId.ts +2 -3
  44. package/src/infrastructure/tracking/tracking.ts +2 -2
  45. package/src/infrastructure/tracking/useTrackCheckout.ts +56 -66
  46. package/src/infrastructure/ui/Root.tsx +14 -10
  47. package/src/infrastructure/ui/components/templates/header/itemHeader/ItemHeader.test.tsx +6 -0
  48. package/src/infrastructure/ui/components/templates/header/itemHeader/ItemHeader.tsx +0 -1
  49. package/src/infrastructure/ui/hooks/usePaymentInstrumentEvents.ts +60 -18
  50. package/src/infrastructure/ui/hooks/useStaticInfo.test.tsx +6 -1
  51. package/src/infrastructure/ui/hooks/useStaticInfo.tsx +13 -2
  52. package/src/infrastructure/ui/hooks/useSubmitCheckout.test.ts +297 -0
  53. package/src/infrastructure/ui/hooks/useSubmitCheckout.ts +169 -0
  54. package/src/infrastructure/ui/i18n/i18n.ts +0 -1
  55. package/src/infrastructure/ui/routing/CheckoutMiddleware.test.tsx +9 -1
  56. package/src/infrastructure/ui/routing/CheckoutMiddleware.tsx +15 -1
  57. package/src/infrastructure/ui/routing/Routing.tsx +29 -15
  58. package/src/infrastructure/ui/routing/routes.ts +1 -0
  59. package/src/infrastructure/ui/views/App.tsx +13 -5
  60. package/src/infrastructure/ui/views/checkout/Checkout.style.ts +0 -3
  61. package/src/infrastructure/ui/views/checkout/Checkout.test.tsx +43 -51
  62. package/src/infrastructure/ui/views/checkout/Checkout.tsx +13 -51
  63. package/src/infrastructure/ui/views/checkout/components/checkoutPaymentModal/CheckoutPaymentModal.test.tsx +134 -0
  64. package/src/infrastructure/ui/views/checkout/components/checkoutPaymentModal/CheckoutPaymentModal.tsx +124 -0
  65. package/src/infrastructure/ui/views/checkout/components/paymentInstrument/PaymentInstrument.tsx +8 -8
  66. package/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.test.tsx +6 -0
  67. package/src/infrastructure/ui/views/summary/Summary.tsx +1 -1
  68. package/src/infrastructure/ui/views/summaryTabs/SummaryTabs.test.tsx +4 -1
  69. package/src/projection/customer/customer.ts +0 -2
  70. package/src/projection/order/order.ts +1 -1
  71. package/src/projection/subscription/subscription.ts +1 -1
  72. package/dist/public/public/assets/adaptive-icon.png +0 -0
  73. package/dist/public/public/assets/favicon.png +0 -0
  74. package/dist/public/public/assets/icon.png +0 -0
  75. package/dist/public/public/assets/splash.png +0 -0
  76. package/dist/public/public/images/not-found.png +0 -0
  77. package/dist/src/infrastructure/ui/hooks/useCheckoutFlow.d.ts +0 -26
  78. package/dist/src/infrastructure/ui/hooks/useCheckoutFlow.js +0 -127
  79. package/dist/src/infrastructure/ui/routing/useBasePath.d.ts +0 -8
  80. package/dist/src/infrastructure/ui/routing/useBasePath.js +0 -9
  81. package/src/infrastructure/ui/hooks/useCheckoutFlow.test.tsx +0 -302
  82. package/src/infrastructure/ui/hooks/useCheckoutFlow.tsx +0 -203
@@ -1,94 +1,84 @@
1
1
  import { useCallback } from "react";
2
- import invariant from "tiny-invariant";
3
2
  import { Country } from "@lookiero/sty-psp-locale";
4
3
  import { Segment } from "@lookiero/sty-psp-segment";
5
4
  import { useEmitUserEvent } from "@lookiero/sty-psp-tracking";
6
- import { CheckoutItemStatus } from "../../domain/checkoutItem/model/checkoutItem";
7
5
  import { Currency } from "../../domain/checkoutItem/model/currency";
8
- import { CheckoutProjection } from "../../projection/checkout/checkout";
9
- import { OrderProjection } from "../../projection/order/order";
10
- import { PricingProjection } from "../../projection/pricing/pricing";
11
- import { SubscriptionProjection } from "../../projection/subscription/subscription";
6
+ import { Subscription } from "../../projection/subscription/subscription";
12
7
  import { PROJECT, TrackingPage } from "./tracking";
13
8
  import { CheckoutTrackingEvent, TrackingEventName, TrackingEventCategory } from "./tracking";
14
9
 
10
+ interface TrackCheckoutFunctionArgs {
11
+ readonly userId: string;
12
+ readonly totalReplacedFor: number;
13
+ readonly isFirstOrder: boolean;
14
+ readonly totalCheckoutItemsKept: number;
15
+ readonly currencyCode: Currency;
16
+ readonly subscription: Subscription;
17
+ readonly coupon: string | null;
18
+ readonly orderNumber: number;
19
+ readonly pendingToPay: number;
20
+ }
15
21
  interface TrackCheckoutFunction {
16
- (): void;
22
+ (args: TrackCheckoutFunctionArgs): void;
17
23
  }
18
24
 
19
25
  interface UseTrackCheckoutFunctionArgs {
20
- readonly order: OrderProjection;
21
- readonly checkout: CheckoutProjection | undefined;
22
- readonly pricing: PricingProjection | undefined;
23
- readonly subscription: SubscriptionProjection;
24
- readonly userId: string;
26
+ readonly page: TrackingPage;
25
27
  readonly country: Country;
28
+ readonly checkoutId: string | undefined;
26
29
  readonly segment: Segment;
27
30
  }
28
-
29
31
  interface UseTrackCheckoutFunction {
30
32
  (args: UseTrackCheckoutFunctionArgs): TrackCheckoutFunction;
31
33
  }
32
34
 
33
- const useTrackCheckout: UseTrackCheckoutFunction = ({
34
- order,
35
- checkout,
36
- pricing,
37
- subscription,
38
- segment,
39
- country,
40
- userId,
41
- }) => {
35
+ const useTrackCheckout: UseTrackCheckoutFunction = ({ page, country, checkoutId, segment }) => {
42
36
  const emitUserEvent = useEmitUserEvent<CheckoutTrackingEvent>();
43
- const { coupon, isFirstOrder, orderNumber } = order;
44
-
45
- const trackCheckout: TrackCheckoutFunction = useCallback(() => {
46
- invariant(checkout, "Checkout must be defined to track checkout");
47
37
 
48
- const checkoutItemsKept = checkout.items.filter(
49
- (checkoutItem) =>
50
- checkoutItem.status === CheckoutItemStatus.KEPT || checkoutItem.status === CheckoutItemStatus.REPLACED,
51
- );
52
- const totalReplacedFor = checkoutItemsKept?.filter(({ replacedFor }) => Boolean(replacedFor)).length || 0;
53
-
54
- const checkoutTrackingEvent: CheckoutTrackingEvent = {
55
- event: TrackingEventName.CHECKOUT,
56
- eventCategory: TrackingEventCategory.ECOMMERCE,
57
- section: `${PROJECT}_${TrackingPage.CHECKOUT}`,
58
- store: country,
59
- segment,
60
- checkoutId: checkout.id,
61
- userId,
62
- sizeChanges: totalReplacedFor,
38
+ const trackCheckout: TrackCheckoutFunction = useCallback(
39
+ ({
40
+ coupon,
41
+ currencyCode,
63
42
  isFirstOrder,
64
- ecommerce: {
65
- checkout: {
66
- actionField: {
67
- items: checkoutItemsKept.length || 0,
68
- currencyCode: pricing?.pendingToPay.currency as Currency,
69
- subscription,
70
- coupon,
71
- orderId: orderNumber,
72
- value: (pricing?.pendingToPay.amount as number) / 100,
43
+ orderNumber,
44
+ pendingToPay,
45
+ subscription,
46
+ totalCheckoutItemsKept,
47
+ totalReplacedFor,
48
+ userId,
49
+ }) => {
50
+ if (!checkoutId) {
51
+ return;
52
+ }
53
+
54
+ const checkoutTrackingEvent: CheckoutTrackingEvent = {
55
+ event: TrackingEventName.CHECKOUT,
56
+ eventCategory: TrackingEventCategory.ECOMMERCE,
57
+ section: `${PROJECT}_${page}`,
58
+ store: country,
59
+ segment,
60
+ checkoutId,
61
+ userId,
62
+ sizeChanges: totalReplacedFor,
63
+ isFirstOrder,
64
+ ecommerce: {
65
+ checkout: {
66
+ actionField: {
67
+ items: totalCheckoutItemsKept,
68
+ currencyCode,
69
+ subscription,
70
+ coupon,
71
+ orderId: orderNumber,
72
+ value: pendingToPay,
73
+ },
73
74
  },
74
75
  },
75
- },
76
- };
76
+ };
77
77
 
78
- emitUserEvent(checkoutTrackingEvent);
79
- }, [
80
- checkout,
81
- country,
82
- coupon,
83
- emitUserEvent,
84
- isFirstOrder,
85
- orderNumber,
86
- pricing?.pendingToPay.amount,
87
- pricing?.pendingToPay.currency,
88
- segment,
89
- subscription,
90
- userId,
91
- ]);
78
+ emitUserEvent(checkoutTrackingEvent);
79
+ },
80
+ [checkoutId, country, emitUserEvent, page, segment],
81
+ );
92
82
 
93
83
  return trackCheckout;
94
84
  };
@@ -8,9 +8,10 @@ import { MessagingRoot } from "@lookiero/messaging-react/bootstrap";
8
8
  import { Locale } from "@lookiero/sty-psp-locale";
9
9
  import { SentryEnvironment, SentryLoggerFunctionArgs, sentryLogger, sentryLoggerHOC } from "@lookiero/sty-psp-logging";
10
10
  import { Layout } from "@lookiero/sty-psp-ui";
11
+ import { Tradename } from "@lookiero/sty-sp-tradename";
11
12
  import { Customer } from "../../projection/customer/customer";
12
- import { OrderProjection } from "../../projection/order/order";
13
- import { SubscriptionProjection } from "../../projection/subscription/subscription";
13
+ import { Order } from "../../projection/order/order";
14
+ import { Subscription } from "../../projection/subscription/subscription";
14
15
  import { KameleoonEnvironment } from "../ab-testing/kameleoonEnvironment";
15
16
  import { QueryBusProvider } from "./hooks/useQueryBus";
16
17
  import { Routing } from "./routing/Routing";
@@ -18,8 +19,8 @@ import { Routing } from "./routing/Routing";
18
19
  interface RootFunctionArgs {
19
20
  readonly Messaging: MessagingRoot;
20
21
  readonly I18n: I18n;
21
- readonly queryBus: QueryBus;
22
22
  readonly development?: boolean;
23
+ readonly queryBus: QueryBus;
23
24
  readonly sentry: () => SentryEnvironment;
24
25
  readonly getAuthToken: () => Promise<string>;
25
26
  readonly kameleoon: () => KameleoonEnvironment;
@@ -31,13 +32,14 @@ interface RootFunction {
31
32
 
32
33
  interface RootProps {
33
34
  readonly basePath: string;
34
- readonly locale: Locale;
35
+ readonly locale?: Locale;
35
36
  readonly customer: Customer;
36
- readonly order: OrderProjection;
37
- readonly subscription: SubscriptionProjection;
37
+ readonly order: Order | undefined;
38
+ readonly subscription: Subscription | undefined;
38
39
  readonly layout: Layout;
40
+ readonly tradename: Tradename;
39
41
  readonly onNotAccessible: () => void;
40
- readonly onCheckoutFlowSuccess: () => void;
42
+ readonly onCheckoutSubmitted?: () => void;
41
43
  readonly useRedirect: () => Record<string, string>;
42
44
  readonly useRoutes?: typeof reactRouterUseRoutes;
43
45
  }
@@ -57,13 +59,14 @@ const root: RootFunction = ({
57
59
  // eslint-disable-next-line react/display-name, react/prop-types
58
60
  const Root = ({
59
61
  basePath,
60
- locale,
62
+ locale = Locale.en_GB,
61
63
  customer,
62
64
  order,
63
65
  subscription,
64
66
  layout,
67
+ tradename,
65
68
  onNotAccessible,
66
- onCheckoutFlowSuccess,
69
+ onCheckoutSubmitted,
67
70
  useRedirect,
68
71
  useRoutes = reactRouterUseRoutes,
69
72
  }: RootProps) => {
@@ -82,9 +85,10 @@ const root: RootFunction = ({
82
85
  locale={locale}
83
86
  order={order}
84
87
  subscription={subscription}
88
+ tradename={tradename}
85
89
  useRedirect={useRedirect}
86
90
  useRoutes={useRoutes}
87
- onCheckoutFlowSuccess={onCheckoutFlowSuccess}
91
+ onCheckoutSubmitted={onCheckoutSubmitted}
88
92
  onI18nError={development ? undefined : handleOnI18nError}
89
93
  onNotAccessible={onNotAccessible}
90
94
  />
@@ -6,6 +6,12 @@ import { checkoutItem } from "../../../../../projection/checkoutItem/checkoutIte
6
6
  import { render } from "../../../../test/render";
7
7
  import { ItemHeader } from "./ItemHeader";
8
8
 
9
+ jest.mock("../../../../hooks/useStaticInfo", () => ({
10
+ useStaticInfo: () => ({
11
+ basePath: "",
12
+ }),
13
+ }));
14
+
9
15
  const mockNavigate = jest.fn();
10
16
  const mockGeneratePath = jest.fn();
11
17
  jest.mock("react-router-native", () => ({
@@ -33,7 +33,6 @@ interface ItemHeaderProps {
33
33
  readonly onNext?: OnNextItemFunction;
34
34
  readonly onPrevious?: OnPreviousItemFunction;
35
35
  }
36
-
37
36
  const ItemHeader: FC<ItemHeaderProps> = ({ items, item, onNext, onPrevious }) => {
38
37
  const title = useI18nMessage({ domain: DOMAIN, id: I18nMessages.HEADER_CHECKOUT_TITLE });
39
38
  const itemIndex = items.indexOf(item);
@@ -1,33 +1,75 @@
1
- import { useEffect } from "react";
2
- import { PaymentPayload, Section, usePaymentStatusManager } from "@lookiero/payments-front";
1
+ import { useCallback, useEffect } from "react";
2
+ import { useEvent } from "@lookiero/event";
3
+ import { Logger } from "@lookiero/sty-psp-logging";
4
+ import { NotificationLevel, useCreateToastNotification } from "@lookiero/sty-psp-notifications";
5
+ import { MESSAGING_CONTEXT_ID } from "../../delivery/baseBootstrap";
6
+ import { I18nMessages } from "../i18n/i18n";
7
+
8
+ const PAYMENT_ERROR = "ERROR";
9
+ const PAYMENT_SUCCESS = "PAYMENT_INSTRUMENT_UPDATED";
10
+
11
+ interface Message {
12
+ readonly id: string;
13
+ }
14
+ interface OnSuccessFunctionArgs {
15
+ readonly message: Message;
16
+ }
17
+ interface OnSuccessFunction {
18
+ (args: OnSuccessFunctionArgs): void;
19
+ }
20
+
21
+ interface Toaster {
22
+ readonly id: string;
23
+ }
24
+ interface Error {
25
+ readonly toaster?: Toaster;
26
+ }
27
+ interface OnErrorFunctionArgs {
28
+ readonly error: Error;
29
+ }
30
+ interface OnErrorFunction {
31
+ (args: OnErrorFunctionArgs): void;
32
+ }
3
33
 
4
34
  interface UsePaymentInstrumentEventsFunctionArgs {
5
- readonly onSuccess: (payload: PaymentPayload) => void;
6
- readonly onError: (payload: PaymentPayload) => void;
35
+ readonly logger: Logger;
7
36
  }
8
37
 
9
38
  interface UsePaymentInstrumentEventsFunction {
10
39
  (args: UsePaymentInstrumentEventsFunctionArgs): void;
11
40
  }
12
41
 
13
- const usePaymentInstrumentEvents: UsePaymentInstrumentEventsFunction = ({ onSuccess, onError }) => {
14
- const refreshStatus = usePaymentStatusManager(Section.BOX_CHECKOUT);
42
+ const usePaymentInstrumentEvents: UsePaymentInstrumentEventsFunction = ({ logger }) => {
43
+ const { subscribe, unsubscribe } = useEvent();
15
44
 
16
- useEffect(() => {
17
- const { isLoading, consumePayload } = refreshStatus;
45
+ const [createNotification] = useCreateToastNotification({ contextId: MESSAGING_CONTEXT_ID, logger });
18
46
 
19
- if (isLoading) {
20
- return;
21
- }
47
+ const onSuccess: OnSuccessFunction = useCallback(
48
+ ({ message }) => createNotification({ bodyI18nKey: message.id, level: NotificationLevel.SUCCESS }),
49
+ [createNotification],
50
+ );
22
51
 
23
- consumePayload((payload) => {
24
- if (payload.success) {
25
- onSuccess(payload);
26
- } else {
27
- onError(payload);
52
+ const onError: OnErrorFunction = useCallback(
53
+ ({ error }) => {
54
+ if (error.toaster) {
55
+ createNotification({
56
+ bodyI18nKey: error.toaster.id || I18nMessages.CHECKOUT_TOAST_PAYMENT_ERROR,
57
+ level: NotificationLevel.ERROR,
58
+ });
28
59
  }
29
- });
30
- }, [onError, onSuccess, refreshStatus]);
60
+ },
61
+ [createNotification],
62
+ );
63
+
64
+ useEffect(() => {
65
+ subscribe({ event: PAYMENT_ERROR }, onError);
66
+ subscribe({ event: PAYMENT_SUCCESS }, onSuccess);
67
+
68
+ return () => {
69
+ unsubscribe({ event: PAYMENT_ERROR }, onError);
70
+ unsubscribe({ event: PAYMENT_SUCCESS }, onSuccess);
71
+ };
72
+ }, [subscribe, unsubscribe, createNotification, onError, onSuccess]);
31
73
  };
32
74
 
33
75
  export { usePaymentInstrumentEvents };
@@ -1,18 +1,21 @@
1
1
  import { renderHook, waitFor } from "@testing-library/react-native";
2
2
  import React, { FC } from "react";
3
+ import { Tradename } from "@lookiero/sty-sp-tradename";
3
4
  import { Customer } from "../../../projection/customer/customer";
4
5
  import { KameleoonEnvironment } from "../../ab-testing/kameleoonEnvironment";
5
6
  import { StaticInfoProvider, useStaticInfo as sut } from "./useStaticInfo";
6
7
 
7
8
  const kameleoon = {} as KameleoonEnvironment;
8
9
  const customer = { customerId: "6667283e-5f61-457e-b637-88736265b78f" } as Customer;
10
+ const tradename = Tradename.LOOKIERO;
11
+ const basePath = "";
9
12
 
10
13
  interface WrapperProps {
11
14
  readonly children: JSX.Element;
12
15
  }
13
16
 
14
17
  const Wrapper: FC<WrapperProps> = ({ children }) => (
15
- <StaticInfoProvider customer={customer} kameleoon={kameleoon}>
18
+ <StaticInfoProvider basePath={basePath} customer={customer} kameleoon={kameleoon} tradename={tradename}>
16
19
  {children}
17
20
  </StaticInfoProvider>
18
21
  );
@@ -24,6 +27,8 @@ describe("useStaticInfo hook", () => {
24
27
  const staticInfo = {
25
28
  kameleoon,
26
29
  customer,
30
+ tradename,
31
+ basePath,
27
32
  };
28
33
 
29
34
  await waitFor(() => expect(result.current).toStrictEqual(staticInfo));
@@ -1,11 +1,13 @@
1
1
  import React, { createContext, FC, ReactNode, useContext, useMemo } from "react";
2
2
  import invariant from "tiny-invariant";
3
+ import { Tradename } from "@lookiero/sty-sp-tradename";
3
4
  import { Customer } from "../../../projection/customer/customer";
4
5
  import { KameleoonEnvironment } from "../../ab-testing/kameleoonEnvironment";
5
6
 
6
7
  interface StaticInfo {
7
8
  readonly kameleoon: KameleoonEnvironment;
8
9
  readonly customer: Customer;
10
+ readonly tradename: Tradename;
9
11
  readonly basePath: string;
10
12
  }
11
13
 
@@ -15,11 +17,20 @@ interface StaticInfoProviderProps {
15
17
  readonly children: ReactNode;
16
18
  readonly kameleoon: KameleoonEnvironment;
17
19
  readonly customer: Customer;
20
+ readonly tradename: Tradename;
18
21
  readonly basePath: string;
19
22
  }
20
23
 
21
- const StaticInfoProvider: FC<StaticInfoProviderProps> = ({ children, kameleoon, customer, basePath }) => {
22
- const value = useMemo(() => ({ kameleoon, customer, basePath }), [customer, kameleoon, basePath]);
24
+ const StaticInfoProvider: FC<StaticInfoProviderProps> = ({ children, kameleoon, customer, tradename, basePath }) => {
25
+ const value = useMemo(
26
+ () => ({
27
+ kameleoon,
28
+ customer,
29
+ tradename,
30
+ basePath,
31
+ }),
32
+ [basePath, customer, kameleoon, tradename],
33
+ );
23
34
 
24
35
  return <StaticInfoContext.Provider value={value}>{children}</StaticInfoContext.Provider>;
25
36
  };