@lookiero/checkout 0.6.0-beta.21 → 0.6.0-beta.22

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,4 @@
1
- import React, { memo, useCallback } from "react";
1
+ import React, { useCallback } from "react";
2
2
  import { Platform } from "react-native";
3
3
  import { useRoutes as reactRouterUseRoutes } from "react-router-native";
4
4
  import { sentryLogger } from "../../shared/logging/SentryLogger";
@@ -10,6 +10,6 @@ const root = ({ Messaging, I18n, getAuthToken, development, sentry }) => {
10
10
  return (React.createElement(Messaging, { includeReactQueryDevTools: Platform.OS === "web" },
11
11
  React.createElement(Routing, { I18n: I18n, basePath: basePath, customer: customer, getAuthToken: getAuthToken, locale: locale, menu: menu, tabBar: tabBar, useRedirect: useRedirect, useRoutes: useRoutes, onI18nError: development ? undefined : handleOnI18nError, onNotAccessible: onNotAccessible })));
12
12
  };
13
- return memo(sentryLogger(sentry)(Root));
13
+ return sentryLogger(sentry)(Root);
14
14
  };
15
15
  export { root };
@@ -1,4 +1,4 @@
1
- import React, { lazy, Suspense } from "react";
1
+ import React, { lazy, Suspense, useMemo } from "react";
2
2
  import { Navigate, Outlet } from "react-router-native";
3
3
  import { Spinner } from "../../../shared/ui/components/atoms/spinner/Spinner";
4
4
  import { App } from "../views/App";
@@ -13,7 +13,7 @@ const Summary = lazy(() => import("../views/summary/Summary").then((module) => (
13
13
  const Checkout = lazy(() => import("../views/checkout/Checkout").then((module) => ({ default: module.Checkout })));
14
14
  const Feedback = lazy(() => import("../views/feedback/Feedback").then((module) => ({ default: module.Feedback })));
15
15
  const Routing = ({ basePath = "", customer, locale, I18n, menu, tabBar, getAuthToken, onI18nError, onNotAccessible, useRedirect, useRoutes, }) => {
16
- const routes = useRoutes([
16
+ const routes = useMemo(() => useRoutes([
17
17
  {
18
18
  path: "",
19
19
  element: (React.createElement(BasePathProvider, { basePath: basePath },
@@ -51,7 +51,7 @@ const Routing = ({ basePath = "", customer, locale, I18n, menu, tabBar, getAuthT
51
51
  children: [
52
52
  {
53
53
  path: Routes.CHECKOUT_PAYMENT,
54
- element: React.createElement(CheckoutPaymentModal, { customerId: customer?.customerId, getAuthToken: getAuthToken }),
54
+ element: (React.createElement(CheckoutPaymentModal, { customerId: customer?.customerId, getAuthToken: getAuthToken })),
55
55
  },
56
56
  ],
57
57
  },
@@ -66,6 +66,19 @@ const Routing = ({ basePath = "", customer, locale, I18n, menu, tabBar, getAuthT
66
66
  },
67
67
  ],
68
68
  },
69
+ ]), [
70
+ I18n,
71
+ basePath,
72
+ customer?.country,
73
+ customer?.customerId,
74
+ getAuthToken,
75
+ locale,
76
+ menu,
77
+ onI18nError,
78
+ onNotAccessible,
79
+ tabBar,
80
+ useRedirect,
81
+ useRoutes,
69
82
  ]);
70
83
  return routes;
71
84
  };
@@ -88,9 +88,9 @@ const sentryLogger = ({ publicKey, environment, release, project }) => {
88
88
  hub.endSession();
89
89
  makeMain(mainHub);
90
90
  };
91
+ const useRoutes = wrapUseRoutes(reactRouterUseRoutes);
91
92
  return (Component) => {
92
93
  const WrappedComponent = wrap(Component);
93
- const useRoutes = wrapUseRoutes(reactRouterUseRoutes);
94
94
  const SentryLogger = (props) => {
95
95
  const { customer } = props;
96
96
  useEffect(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lookiero/checkout",
3
- "version": "0.6.0-beta.21",
3
+ "version": "0.6.0-beta.22",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [