@dynamic-labs/sdk-react-core 0.18.0-RC.13 → 0.18.0-RC.15

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 (97) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/package.cjs +2 -2
  3. package/package.js +2 -2
  4. package/package.json +9 -9
  5. package/src/index.cjs +2 -0
  6. package/src/index.js +1 -0
  7. package/src/lib/Main.cjs +46 -7
  8. package/src/lib/Main.js +46 -7
  9. package/src/lib/assets/no-wallet-found.cjs +8 -8
  10. package/src/lib/assets/no-wallet-found.js +8 -8
  11. package/src/lib/components/PoweredByDynamic/PoweredByDynamic.cjs +8 -1
  12. package/src/lib/components/PoweredByDynamic/PoweredByDynamic.js +8 -1
  13. package/src/lib/components/SendBalancePageLayout/SendBalancePageLayout.cjs +1 -1
  14. package/src/lib/components/SendBalancePageLayout/SendBalancePageLayout.js +1 -1
  15. package/src/lib/components/Toolkit/Toolkit.cjs +3 -3
  16. package/src/lib/components/Toolkit/Toolkit.js +3 -3
  17. package/src/lib/components/Toolkit/components/MultiWalletSwitch.cjs +18 -0
  18. package/src/lib/components/Toolkit/components/MultiWalletSwitch.d.ts +8 -0
  19. package/src/lib/components/Toolkit/components/MultiWalletSwitch.js +14 -0
  20. package/src/lib/components/Toolkit/components/index.d.ts +1 -1
  21. package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.cjs +1 -1
  22. package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.js +1 -1
  23. package/src/lib/components/TransactionStatusLayout/TransactionStatusLayout.cjs +1 -1
  24. package/src/lib/components/TransactionStatusLayout/TransactionStatusLayout.js +1 -1
  25. package/src/lib/context/DynamicContext/DynamicContext.cjs +51 -23
  26. package/src/lib/context/DynamicContext/DynamicContext.d.ts +6 -3
  27. package/src/lib/context/DynamicContext/DynamicContext.js +52 -25
  28. package/src/lib/context/DynamicContext/helpers.cjs +5 -4
  29. package/src/lib/context/DynamicContext/helpers.d.ts +3 -1
  30. package/src/lib/context/DynamicContext/helpers.js +5 -4
  31. package/src/lib/context/DynamicContext/useCustomerCallbacks/types.d.ts +1 -0
  32. package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerCallbacks.cjs +1 -1
  33. package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerCallbacks.d.ts +2 -2
  34. package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerCallbacks.js +1 -1
  35. package/src/lib/context/DynamicContext/useDynamicContext.cjs +2 -2
  36. package/src/lib/context/DynamicContext/useDynamicContext.d.ts +1 -1
  37. package/src/lib/context/DynamicContext/useDynamicContext.js +2 -2
  38. package/src/lib/layout/DynamicAuthLayout/HelpContent/WalletListHelpContent/NewToWeb3WalletItem/NewToWeb3WalletItem.cjs +1 -1
  39. package/src/lib/layout/DynamicAuthLayout/HelpContent/WalletListHelpContent/NewToWeb3WalletItem/NewToWeb3WalletItem.js +1 -1
  40. package/src/lib/shared/types/index.d.ts +1 -0
  41. package/src/lib/shared/utils/classes/storage/localStorage.cjs +36 -24
  42. package/src/lib/shared/utils/classes/storage/localStorage.d.ts +16 -3
  43. package/src/lib/shared/utils/classes/storage/localStorage.js +37 -25
  44. package/src/lib/shared/utils/hooks/index.d.ts +1 -0
  45. package/src/lib/shared/utils/hooks/useEffectOnce/index.d.ts +1 -0
  46. package/src/lib/shared/utils/hooks/useEffectOnce/useEffectOnce.cjs +27 -0
  47. package/src/lib/shared/utils/hooks/useEffectOnce/useEffectOnce.d.ts +17 -0
  48. package/src/lib/shared/utils/hooks/useEffectOnce/useEffectOnce.js +23 -0
  49. package/src/lib/styles/index.shadow.cjs +1 -1
  50. package/src/lib/styles/index.shadow.js +1 -1
  51. package/src/lib/utils/functions/getAuthToken/getAuthToken.cjs +2 -1
  52. package/src/lib/utils/functions/getAuthToken/getAuthToken.d.ts +1 -1
  53. package/src/lib/utils/functions/getAuthToken/getAuthToken.js +2 -1
  54. package/src/lib/utils/functions/isSelectedWalletAlreadyConnected/isSelectedWalletAlreadyConnected.cjs +2 -2
  55. package/src/lib/utils/functions/isSelectedWalletAlreadyConnected/isSelectedWalletAlreadyConnected.d.ts +1 -1
  56. package/src/lib/utils/functions/isSelectedWalletAlreadyConnected/isSelectedWalletAlreadyConnected.js +2 -2
  57. package/src/lib/utils/functions/storeAuthToken/index.cjs +1 -3
  58. package/src/lib/utils/functions/storeAuthToken/index.js +1 -3
  59. package/src/lib/utils/hooks/index.d.ts +2 -0
  60. package/src/lib/utils/hooks/multiWallet/useMultiWallet/index.d.ts +1 -0
  61. package/src/lib/utils/hooks/multiWallet/useMultiWallet/useMultiWallet.cjs +17 -0
  62. package/src/lib/utils/hooks/multiWallet/useMultiWallet/useMultiWallet.d.ts +8 -0
  63. package/src/lib/utils/hooks/multiWallet/useMultiWallet/useMultiWallet.js +13 -0
  64. package/src/lib/utils/hooks/useApplyWalletConnectorNetwork/useApplyWalletConnectorNetwork.cjs +29 -0
  65. package/src/lib/utils/hooks/useApplyWalletConnectorNetwork/useApplyWalletConnectorNetwork.d.ts +5 -0
  66. package/src/lib/utils/hooks/useApplyWalletConnectorNetwork/useApplyWalletConnectorNetwork.js +25 -0
  67. package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.cjs +20 -5
  68. package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.d.ts +5 -2
  69. package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.js +20 -5
  70. package/src/lib/utils/hooks/useConnectedAccountWallet/useConnectedAccountWallet.cjs +11 -18
  71. package/src/lib/utils/hooks/useConnectedAccountWallet/useConnectedAccountWallet.js +11 -18
  72. package/src/lib/utils/hooks/useEventListener/index.d.ts +1 -0
  73. package/src/lib/utils/hooks/useEventListener/useEventListener.cjs +25 -0
  74. package/src/lib/utils/hooks/useEventListener/useEventListener.d.ts +1 -0
  75. package/src/lib/utils/hooks/useEventListener/useEventListener.js +21 -0
  76. package/src/lib/utils/hooks/usePromise/usePromise.cjs +71 -18
  77. package/src/lib/utils/hooks/usePromise/usePromise.d.ts +14 -0
  78. package/src/lib/utils/hooks/usePromise/usePromise.js +72 -19
  79. package/src/lib/utils/hooks/useWalletItemActions/useWalletItemActions.cjs +3 -3
  80. package/src/lib/utils/hooks/useWalletItemActions/useWalletItemActions.js +3 -3
  81. package/src/lib/views/EmailConfirmationWaitingView/EmailConfirmationWaitingView.cjs +1 -1
  82. package/src/lib/views/EmailConfirmationWaitingView/EmailConfirmationWaitingView.js +1 -1
  83. package/src/lib/views/LoginWithEmailView/components/LoginWithEmailWalletList/LoginWithEmailWalletList.cjs +2 -2
  84. package/src/lib/views/LoginWithEmailView/components/LoginWithEmailWalletList/LoginWithEmailWalletList.js +2 -2
  85. package/src/lib/views/NetworkNotSupported/NetworkNotSupported.cjs +9 -8
  86. package/src/lib/views/NetworkNotSupported/NetworkNotSupported.js +9 -8
  87. package/src/lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.cjs +5 -9
  88. package/src/lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.js +5 -9
  89. package/src/lib/views/WalletList/SearchNotFoundMessage/SearchNotFoundMessage.cjs +2 -1
  90. package/src/lib/views/WalletList/SearchNotFoundMessage/SearchNotFoundMessage.d.ts +2 -2
  91. package/src/lib/views/WalletList/SearchNotFoundMessage/SearchNotFoundMessage.js +2 -1
  92. package/src/lib/views/WalletList/WalletList.cjs +2 -2
  93. package/src/lib/views/WalletList/WalletList.js +2 -2
  94. package/src/lib/views/WalletList/WalletListItem/WalletListItem.types.d.ts +1 -2
  95. package/src/lib/components/Toolkit/components/BrandStyleSwitch.cjs +0 -22
  96. package/src/lib/components/Toolkit/components/BrandStyleSwitch.d.ts +0 -2
  97. package/src/lib/components/Toolkit/components/BrandStyleSwitch.js +0 -18
@@ -58,7 +58,7 @@ const EmailConfirmationWaitingView = () => {
58
58
  setView('login-with-email-or-wallet');
59
59
  clearStatesOnBackClick();
60
60
  }), [setView, emailConnector, clearStatesOnBackClick]);
61
- return (jsxRuntime.jsxs("div", Object.assign({ className: 'email-confirmation-waiting-view' }, { children: [jsxRuntime.jsx("div", Object.assign({ className: 'email-confirmation-waiting-view__header-icon' }, { children: jsxRuntime.jsx(IconWithSpinner.IconWithSpinner, { Icon: iconic.SignInWithEmailIcon, iconSize: 80, isSpinning: true }) })), jsxRuntime.jsx(Typography.Typography, Object.assign({ weight: 'medium', variant: 'title', color: 'primary', className: 'email-confirmation-waiting-view__title' }, { children: "Confirm your email" })), jsxRuntime.jsxs(Typography.Typography, Object.assign({ weight: 'regular', variant: 'body_normal', color: 'secondary' }, { children: ["We\u2019ve sent a verification email to", ' '] })), jsxRuntime.jsxs("div", Object.assign({ className: 'email-confirmation-waiting-view__email-container' }, { children: [jsxRuntime.jsx(Typography.Typography, Object.assign({ variant: 'body_normal', color: 'secondary', weight: 'medium', as: 'span' }, { children: emailConnector === null || emailConnector === void 0 ? void 0 : emailConnector.email })), jsxRuntime.jsx(IconButton.IconButton, Object.assign({ onClick: onClickResetEmail, className: 'email-confirmation-waiting-view__edit-icon-button', "data-testid": 'email-confirmation-waiting-view__edit-button' }, { children: jsxRuntime.jsx(Icon.Icon, Object.assign({ color: 'text-tertiary' }, { children: jsxRuntime.jsx(pencilAltIcon.ReactComponent, {}) })) }))] })), jsxRuntime.jsx("div", Object.assign({ className: 'email-confirmation-waiting-view__note' }, { children: jsxRuntime.jsx(Typography.Typography, Object.assign({ weight: 'regular', variant: 'body_small', color: 'secondary' }, { children: "Note: it might take a few seconds to proceed after clicking the link in your email" })) })), jsxRuntime.jsx("div", Object.assign({ className: 'email-confirmation-waiting-view__powered_by_dynamic_footer' }, { children: jsxRuntime.jsx(PoweredByDynamic.PoweredByDynamic, {}) }))] })));
61
+ return (jsxRuntime.jsxs("div", Object.assign({ className: 'email-confirmation-waiting-view' }, { children: [jsxRuntime.jsx("div", Object.assign({ className: 'email-confirmation-waiting-view__header-icon' }, { children: jsxRuntime.jsx(IconWithSpinner.IconWithSpinner, { Icon: iconic.SignInWithEmailIcon, iconSize: 80, isSpinning: true }) })), jsxRuntime.jsx(Typography.Typography, Object.assign({ weight: 'medium', variant: 'title', color: 'primary', className: 'email-confirmation-waiting-view__title' }, { children: "Confirm your email" })), jsxRuntime.jsxs(Typography.Typography, Object.assign({ weight: 'regular', variant: 'body_normal', color: 'secondary' }, { children: ["We\u2019ve sent a verification email to", ' '] })), jsxRuntime.jsxs("div", Object.assign({ className: 'email-confirmation-waiting-view__email-container' }, { children: [jsxRuntime.jsx(Typography.Typography, Object.assign({ variant: 'body_normal', color: 'secondary', weight: 'medium', as: 'span' }, { children: emailConnector === null || emailConnector === void 0 ? void 0 : emailConnector.email })), jsxRuntime.jsx(IconButton.IconButton, Object.assign({ onClick: onClickResetEmail, className: 'email-confirmation-waiting-view__edit-icon-button', "data-testid": 'email-confirmation-waiting-view__edit-button' }, { children: jsxRuntime.jsx(Icon.Icon, Object.assign({ color: 'text-tertiary' }, { children: jsxRuntime.jsx(pencilAltIcon.ReactComponent, {}) })) }))] })), jsxRuntime.jsx("div", Object.assign({ className: 'email-confirmation-waiting-view__note' }, { children: jsxRuntime.jsx(Typography.Typography, Object.assign({ weight: 'regular', variant: 'body_small', color: 'secondary' }, { children: "Note: it might take a few seconds to proceed after clicking the link in your email" })) })), jsxRuntime.jsx(PoweredByDynamic.PoweredByDynamic, { classNameRoot: 'email-confirmation-waiting-view__powered_by_dynamic_footer' })] })));
62
62
  };
63
63
 
64
64
  exports.EmailConfirmationWaitingView = EmailConfirmationWaitingView;
@@ -54,7 +54,7 @@ const EmailConfirmationWaitingView = () => {
54
54
  setView('login-with-email-or-wallet');
55
55
  clearStatesOnBackClick();
56
56
  }), [setView, emailConnector, clearStatesOnBackClick]);
57
- return (jsxs("div", Object.assign({ className: 'email-confirmation-waiting-view' }, { children: [jsx("div", Object.assign({ className: 'email-confirmation-waiting-view__header-icon' }, { children: jsx(IconWithSpinner, { Icon: SignInWithEmailIcon, iconSize: 80, isSpinning: true }) })), jsx(Typography, Object.assign({ weight: 'medium', variant: 'title', color: 'primary', className: 'email-confirmation-waiting-view__title' }, { children: "Confirm your email" })), jsxs(Typography, Object.assign({ weight: 'regular', variant: 'body_normal', color: 'secondary' }, { children: ["We\u2019ve sent a verification email to", ' '] })), jsxs("div", Object.assign({ className: 'email-confirmation-waiting-view__email-container' }, { children: [jsx(Typography, Object.assign({ variant: 'body_normal', color: 'secondary', weight: 'medium', as: 'span' }, { children: emailConnector === null || emailConnector === void 0 ? void 0 : emailConnector.email })), jsx(IconButton, Object.assign({ onClick: onClickResetEmail, className: 'email-confirmation-waiting-view__edit-icon-button', "data-testid": 'email-confirmation-waiting-view__edit-button' }, { children: jsx(Icon, Object.assign({ color: 'text-tertiary' }, { children: jsx(SvgPencilAltIcon, {}) })) }))] })), jsx("div", Object.assign({ className: 'email-confirmation-waiting-view__note' }, { children: jsx(Typography, Object.assign({ weight: 'regular', variant: 'body_small', color: 'secondary' }, { children: "Note: it might take a few seconds to proceed after clicking the link in your email" })) })), jsx("div", Object.assign({ className: 'email-confirmation-waiting-view__powered_by_dynamic_footer' }, { children: jsx(PoweredByDynamic, {}) }))] })));
57
+ return (jsxs("div", Object.assign({ className: 'email-confirmation-waiting-view' }, { children: [jsx("div", Object.assign({ className: 'email-confirmation-waiting-view__header-icon' }, { children: jsx(IconWithSpinner, { Icon: SignInWithEmailIcon, iconSize: 80, isSpinning: true }) })), jsx(Typography, Object.assign({ weight: 'medium', variant: 'title', color: 'primary', className: 'email-confirmation-waiting-view__title' }, { children: "Confirm your email" })), jsxs(Typography, Object.assign({ weight: 'regular', variant: 'body_normal', color: 'secondary' }, { children: ["We\u2019ve sent a verification email to", ' '] })), jsxs("div", Object.assign({ className: 'email-confirmation-waiting-view__email-container' }, { children: [jsx(Typography, Object.assign({ variant: 'body_normal', color: 'secondary', weight: 'medium', as: 'span' }, { children: emailConnector === null || emailConnector === void 0 ? void 0 : emailConnector.email })), jsx(IconButton, Object.assign({ onClick: onClickResetEmail, className: 'email-confirmation-waiting-view__edit-icon-button', "data-testid": 'email-confirmation-waiting-view__edit-button' }, { children: jsx(Icon, Object.assign({ color: 'text-tertiary' }, { children: jsx(SvgPencilAltIcon, {}) })) }))] })), jsx("div", Object.assign({ className: 'email-confirmation-waiting-view__note' }, { children: jsx(Typography, Object.assign({ weight: 'regular', variant: 'body_small', color: 'secondary' }, { children: "Note: it might take a few seconds to proceed after clicking the link in your email" })) })), jsx(PoweredByDynamic, { classNameRoot: 'email-confirmation-waiting-view__powered_by_dynamic_footer' })] })));
58
58
  };
59
59
 
60
60
  export { EmailConfirmationWaitingView };
@@ -24,9 +24,9 @@ var ListItemButton = require('../ListItemButton/ListItemButton.cjs');
24
24
  const NUMBER_OF_WALLETS = 3;
25
25
  const LoginWithEmailWalletList = ({ walletsList, numberOfWallets, }) => {
26
26
  const { setView } = ViewContext.useViewContext();
27
- const { projectSettings, connectedWallets } = useInternalDynamicContext.useInternalDynamicContext();
27
+ const { projectSettings } = useInternalDynamicContext.useInternalDynamicContext();
28
28
  const isUsingMultiWallet = Boolean(localStorage.LocalStorage.getFromLS(localStorage$1.AUTH_USER));
29
- return !projectSettings ? (jsxRuntime.jsx(Skeleton.Skeleton, { count: NUMBER_OF_WALLETS + 1, className: 'login-with-email-wallet-list__skeleton' })) : (jsxRuntime.jsxs("div", Object.assign({ className: 'login-with-email-wallet-list__container' }, { children: [walletsList.map((wallet) => (jsxRuntime.jsx(WalletListItem.WalletListItem, { wallet: wallet, connectedWallets: connectedWallets, usingMultiWallet: isUsingMultiWallet }, wallet.key))), jsxRuntime.jsx(ListItemButton.ListItemButton, { text: 'View all wallets', onClick: () => setView('login-with-email-or-wallet-full-wallet-list'), numberOfWallets: numberOfWallets })] })));
29
+ return !projectSettings ? (jsxRuntime.jsx(Skeleton.Skeleton, { count: NUMBER_OF_WALLETS + 1, className: 'login-with-email-wallet-list__skeleton' })) : (jsxRuntime.jsxs("div", Object.assign({ className: 'login-with-email-wallet-list__container' }, { children: [walletsList.map((wallet) => (jsxRuntime.jsx(WalletListItem.WalletListItem, { wallet: wallet, usingMultiWallet: isUsingMultiWallet }, wallet.key))), jsxRuntime.jsx(ListItemButton.ListItemButton, { text: 'View all wallets', onClick: () => setView('login-with-email-or-wallet-full-wallet-list'), numberOfWallets: numberOfWallets })] })));
30
30
  };
31
31
 
32
32
  exports.LoginWithEmailWalletList = LoginWithEmailWalletList;
@@ -20,9 +20,9 @@ import { ListItemButton } from '../ListItemButton/ListItemButton.js';
20
20
  const NUMBER_OF_WALLETS = 3;
21
21
  const LoginWithEmailWalletList = ({ walletsList, numberOfWallets, }) => {
22
22
  const { setView } = useViewContext();
23
- const { projectSettings, connectedWallets } = useInternalDynamicContext();
23
+ const { projectSettings } = useInternalDynamicContext();
24
24
  const isUsingMultiWallet = Boolean(LocalStorage.getFromLS(AUTH_USER));
25
- return !projectSettings ? (jsx(Skeleton, { count: NUMBER_OF_WALLETS + 1, className: 'login-with-email-wallet-list__skeleton' })) : (jsxs("div", Object.assign({ className: 'login-with-email-wallet-list__container' }, { children: [walletsList.map((wallet) => (jsx(WalletListItem, { wallet: wallet, connectedWallets: connectedWallets, usingMultiWallet: isUsingMultiWallet }, wallet.key))), jsx(ListItemButton, { text: 'View all wallets', onClick: () => setView('login-with-email-or-wallet-full-wallet-list'), numberOfWallets: numberOfWallets })] })));
25
+ return !projectSettings ? (jsx(Skeleton, { count: NUMBER_OF_WALLETS + 1, className: 'login-with-email-wallet-list__skeleton' })) : (jsxs("div", Object.assign({ className: 'login-with-email-wallet-list__container' }, { children: [walletsList.map((wallet) => (jsx(WalletListItem, { wallet: wallet, usingMultiWallet: isUsingMultiWallet }, wallet.key))), jsx(ListItemButton, { text: 'View all wallets', onClick: () => setView('login-with-email-or-wallet-full-wallet-list'), numberOfWallets: numberOfWallets })] })));
26
26
  };
27
27
 
28
28
  export { LoginWithEmailWalletList, NUMBER_OF_WALLETS };
@@ -19,7 +19,6 @@ require('ethers');
19
19
  require('../../shared/consts/index.cjs');
20
20
  var useInternalDynamicContext = require('../../context/DynamicContext/useInternalDynamicContext.cjs');
21
21
  require('@dynamic-labs/multi-wallet');
22
- var createUserProfile = require('../../utils/functions/createUserProfile/createUserProfile.cjs');
23
22
  var isSupportedNetwork = require('../../utils/functions/isSupportedNetwork/isSupportedNetwork.cjs');
24
23
  require('../../components/ShadowDOM/ShadowDOM.cjs');
25
24
  require('../../context/ThemeContext/ThemeContext.cjs');
@@ -48,12 +47,11 @@ require('yup');
48
47
  require('../../components/InlineWidget/InlineWidget.cjs');
49
48
  var NetworkPicker = require('../../components/NetworkPicker/NetworkPicker.cjs');
50
49
  var UserAddress = require('../../components/UserAddress/UserAddress.cjs');
51
- var AuthProviderIcon = require('../../components/AuthProviderIcon/AuthProviderIcon.cjs');
52
50
  var SelectNetworkButton = require('../../components/SelectNetworkButton/SelectNetworkButton.cjs');
51
+ var useApplyWalletConnectorNetwork = require('../../utils/hooks/useApplyWalletConnectorNetwork/useApplyWalletConnectorNetwork.cjs');
53
52
 
54
53
  const NetworkNotSupported = () => {
55
- var _a, _b, _c, _d;
56
- const { onboardingOnlyJwt, network, onboardingImageUrl, selectedWalletConnector: walletConnector, decodedOnboardingOnlyToken, setNetwork, } = useInternalDynamicContext.useInternalDynamicContext();
54
+ const { network, onboardingImageUrl, selectedWalletConnector: walletConnector, setNetwork, } = useInternalDynamicContext.useInternalDynamicContext();
57
55
  const finishConnectAndSign = useConnectAndSign.useConnectAndSign();
58
56
  const [isNetworkPickerOpen, setIsNetworkPickerOpen] = React.useState(false);
59
57
  const onChainChange = (network) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
@@ -66,12 +64,13 @@ const NetworkNotSupported = () => {
66
64
  // We can't listen on the network defined in the context,
67
65
  // because events on the primaryWallet are defined after message is signed.
68
66
  useWalletConnectorEvents.useWalletConnectorEvents(walletConnector, { onChainChange });
67
+ // Updates the contexts 'network' based on the selected wallet connector.
68
+ // It helps ensure that the 'network' is always in sync with the wallet's actual network,
69
+ // Prevents 'network' from being 'undefined'.
70
+ useApplyWalletConnectorNetwork.useApplyWalletConnectorNetwork({ walletConnector });
69
71
  if (!walletConnector) {
70
72
  return null;
71
73
  }
72
- const userProfile = decodedOnboardingOnlyToken && createUserProfile.createUserProfile(decodedOnboardingOnlyToken);
73
- const evmNetworks = walletConnector.evmNetworks || [];
74
- const _isSupportedNetwork = isSupportedNetwork.isSupportedNetwork({ network, walletConnector });
75
74
  const onSelectNetworkButtonClick = (networkId) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
76
75
  try {
77
76
  yield walletConnector.switchNetwork({
@@ -84,7 +83,9 @@ const NetworkNotSupported = () => {
84
83
  logger.logger.debug(e);
85
84
  }
86
85
  });
87
- return (jsxRuntime.jsxs("div", Object.assign({ className: 'network-not-supported', "data-testid": 'network-not-supported' }, { children: [onboardingImageUrl && (jsxRuntime.jsx("img", { className: 'network-not-supported__main-img', src: onboardingImageUrl, alt: 'onboarding' })), !_isSupportedNetwork && (jsxRuntime.jsx(ErrorContainer.ErrorContainer, Object.assign({ variant: 'info', withIcon: false, className: 'network-not-supported__error--not-supported' }, { children: "This network is not available, please update." }))), jsxRuntime.jsxs("div", Object.assign({ className: 'network-not-supported__content-container' }, { children: [jsxRuntime.jsxs("div", Object.assign({ className: 'network-not-supported__img-container' }, { children: [((_a = userProfile === null || userProfile === void 0 ? void 0 : userProfile.ens) === null || _a === void 0 ? void 0 : _a.avatar) && (jsxRuntime.jsx("div", Object.assign({ className: 'network-not-supported__network-container' }, { children: jsxRuntime.jsx("img", { src: (_b = userProfile === null || userProfile === void 0 ? void 0 : userProfile.ens) === null || _b === void 0 ? void 0 : _b.avatar, alt: 'user ens avatar', className: 'network-not-supported__img' }) }))), !((_c = userProfile === null || userProfile === void 0 ? void 0 : userProfile.ens) === null || _c === void 0 ? void 0 : _c.avatar) && onboardingOnlyJwt && (jsxRuntime.jsx(AuthProviderIcon.AuthProviderIcon, { jwt: onboardingOnlyJwt })), !((_d = userProfile === null || userProfile === void 0 ? void 0 : userProfile.ens) === null || _d === void 0 ? void 0 : _d.avatar) && !onboardingOnlyJwt && (jsxRuntime.jsx(walletBook.WalletIcon, { style: { height: 64, width: 64 }, walletName: walletConnector.name }))] })), jsxRuntime.jsx(UserAddress.UserAddress, { walletConnector: walletConnector, userProfile: userProfile }), jsxRuntime.jsx("div", Object.assign({ className: 'network-not-supported__network-container' }, { children: evmNetworks.length > 1 && (jsxRuntime.jsx(NetworkPicker.NetworkPicker, { evmNetworks: evmNetworks, connector: walletConnector, isNetworkPickerOpen: isNetworkPickerOpen, setIsNetworkPickerOpen: setIsNetworkPickerOpen, showNetworkName: true, buttonClassName: 'network-not-supported__network-picker-button', mainClassName: 'network-not-supported__network-picker' })) })), jsxRuntime.jsxs("div", Object.assign({ className: 'network-not-supported__welcome-container' }, { children: [jsxRuntime.jsx(Typography.Typography, Object.assign({ variant: 'title', color: 'primary', className: 'network-not-supported__welcome-title' }, { children: "Update Network" })), jsxRuntime.jsx(Typography.Typography, Object.assign({ variant: 'body_normal', weight: 'regular', color: 'secondary' }, { children: "Your wallet is not connected to a supported network. Please update before continuing." }))] })), evmNetworks.length === 1 && (jsxRuntime.jsx(SelectNetworkButton.SelectNetworkButton, { onClick: onSelectNetworkButtonClick, networkId: evmNetworks[0].networkId, networkName: evmNetworks[0].vanityName || evmNetworks[0].name, networkIconUrl: evmNetworks[0].iconUrls[0] }))] }))] })));
86
+ const evmNetworks = walletConnector.evmNetworks || [];
87
+ const _isSupportedNetwork = isSupportedNetwork.isSupportedNetwork({ network, walletConnector });
88
+ return (jsxRuntime.jsxs("div", Object.assign({ className: 'network-not-supported', "data-testid": 'network-not-supported' }, { children: [onboardingImageUrl && (jsxRuntime.jsx("img", { className: 'network-not-supported__main-img', src: onboardingImageUrl, alt: 'onboarding' })), !_isSupportedNetwork && (jsxRuntime.jsx(ErrorContainer.ErrorContainer, Object.assign({ variant: 'info', withIcon: false, className: 'network-not-supported__error--not-supported' }, { children: "This network is not available, please update." }))), jsxRuntime.jsxs("div", Object.assign({ className: 'network-not-supported__content-container' }, { children: [jsxRuntime.jsx("div", Object.assign({ className: 'network-not-supported__img-container' }, { children: jsxRuntime.jsx(walletBook.WalletIcon, { style: { height: 64, width: 64 }, walletName: walletConnector.name }) })), jsxRuntime.jsx(UserAddress.UserAddress, { walletConnector: walletConnector }), jsxRuntime.jsx("div", Object.assign({ className: 'network-not-supported__network-container' }, { children: evmNetworks.length > 1 && (jsxRuntime.jsx(NetworkPicker.NetworkPicker, { evmNetworks: evmNetworks, connector: walletConnector, isNetworkPickerOpen: isNetworkPickerOpen, setIsNetworkPickerOpen: setIsNetworkPickerOpen, showNetworkName: true, buttonClassName: 'network-not-supported__network-picker-button', mainClassName: 'network-not-supported__network-picker' })) })), jsxRuntime.jsxs("div", Object.assign({ className: 'network-not-supported__welcome-container' }, { children: [jsxRuntime.jsx(Typography.Typography, Object.assign({ variant: 'title', color: 'primary', className: 'network-not-supported__welcome-title' }, { children: "Update Network" })), jsxRuntime.jsx(Typography.Typography, Object.assign({ variant: 'body_normal', weight: 'regular', color: 'secondary' }, { children: "Your wallet is not connected to a supported network. Please update before continuing." }))] })), evmNetworks.length === 1 && (jsxRuntime.jsx(SelectNetworkButton.SelectNetworkButton, { onClick: onSelectNetworkButtonClick, networkId: evmNetworks[0].networkId, networkName: evmNetworks[0].vanityName || evmNetworks[0].name, networkIconUrl: evmNetworks[0].iconUrls[0] }))] }))] })));
88
89
  };
89
90
 
90
91
  exports.NetworkNotSupported = NetworkNotSupported;
@@ -15,7 +15,6 @@ import 'ethers';
15
15
  import '../../shared/consts/index.js';
16
16
  import { useInternalDynamicContext } from '../../context/DynamicContext/useInternalDynamicContext.js';
17
17
  import '@dynamic-labs/multi-wallet';
18
- import { createUserProfile } from '../../utils/functions/createUserProfile/createUserProfile.js';
19
18
  import { isSupportedNetwork } from '../../utils/functions/isSupportedNetwork/isSupportedNetwork.js';
20
19
  import '../../components/ShadowDOM/ShadowDOM.js';
21
20
  import '../../context/ThemeContext/ThemeContext.js';
@@ -44,12 +43,11 @@ import 'yup';
44
43
  import '../../components/InlineWidget/InlineWidget.js';
45
44
  import { NetworkPicker } from '../../components/NetworkPicker/NetworkPicker.js';
46
45
  import { UserAddress } from '../../components/UserAddress/UserAddress.js';
47
- import { AuthProviderIcon } from '../../components/AuthProviderIcon/AuthProviderIcon.js';
48
46
  import { SelectNetworkButton } from '../../components/SelectNetworkButton/SelectNetworkButton.js';
47
+ import { useApplyWalletConnectorNetwork } from '../../utils/hooks/useApplyWalletConnectorNetwork/useApplyWalletConnectorNetwork.js';
49
48
 
50
49
  const NetworkNotSupported = () => {
51
- var _a, _b, _c, _d;
52
- const { onboardingOnlyJwt, network, onboardingImageUrl, selectedWalletConnector: walletConnector, decodedOnboardingOnlyToken, setNetwork, } = useInternalDynamicContext();
50
+ const { network, onboardingImageUrl, selectedWalletConnector: walletConnector, setNetwork, } = useInternalDynamicContext();
53
51
  const finishConnectAndSign = useConnectAndSign();
54
52
  const [isNetworkPickerOpen, setIsNetworkPickerOpen] = useState(false);
55
53
  const onChainChange = (network) => __awaiter(void 0, void 0, void 0, function* () {
@@ -62,12 +60,13 @@ const NetworkNotSupported = () => {
62
60
  // We can't listen on the network defined in the context,
63
61
  // because events on the primaryWallet are defined after message is signed.
64
62
  useWalletConnectorEvents(walletConnector, { onChainChange });
63
+ // Updates the contexts 'network' based on the selected wallet connector.
64
+ // It helps ensure that the 'network' is always in sync with the wallet's actual network,
65
+ // Prevents 'network' from being 'undefined'.
66
+ useApplyWalletConnectorNetwork({ walletConnector });
65
67
  if (!walletConnector) {
66
68
  return null;
67
69
  }
68
- const userProfile = decodedOnboardingOnlyToken && createUserProfile(decodedOnboardingOnlyToken);
69
- const evmNetworks = walletConnector.evmNetworks || [];
70
- const _isSupportedNetwork = isSupportedNetwork({ network, walletConnector });
71
70
  const onSelectNetworkButtonClick = (networkId) => __awaiter(void 0, void 0, void 0, function* () {
72
71
  try {
73
72
  yield walletConnector.switchNetwork({
@@ -80,7 +79,9 @@ const NetworkNotSupported = () => {
80
79
  logger.debug(e);
81
80
  }
82
81
  });
83
- return (jsxs("div", Object.assign({ className: 'network-not-supported', "data-testid": 'network-not-supported' }, { children: [onboardingImageUrl && (jsx("img", { className: 'network-not-supported__main-img', src: onboardingImageUrl, alt: 'onboarding' })), !_isSupportedNetwork && (jsx(ErrorContainer, Object.assign({ variant: 'info', withIcon: false, className: 'network-not-supported__error--not-supported' }, { children: "This network is not available, please update." }))), jsxs("div", Object.assign({ className: 'network-not-supported__content-container' }, { children: [jsxs("div", Object.assign({ className: 'network-not-supported__img-container' }, { children: [((_a = userProfile === null || userProfile === void 0 ? void 0 : userProfile.ens) === null || _a === void 0 ? void 0 : _a.avatar) && (jsx("div", Object.assign({ className: 'network-not-supported__network-container' }, { children: jsx("img", { src: (_b = userProfile === null || userProfile === void 0 ? void 0 : userProfile.ens) === null || _b === void 0 ? void 0 : _b.avatar, alt: 'user ens avatar', className: 'network-not-supported__img' }) }))), !((_c = userProfile === null || userProfile === void 0 ? void 0 : userProfile.ens) === null || _c === void 0 ? void 0 : _c.avatar) && onboardingOnlyJwt && (jsx(AuthProviderIcon, { jwt: onboardingOnlyJwt })), !((_d = userProfile === null || userProfile === void 0 ? void 0 : userProfile.ens) === null || _d === void 0 ? void 0 : _d.avatar) && !onboardingOnlyJwt && (jsx(WalletIcon, { style: { height: 64, width: 64 }, walletName: walletConnector.name }))] })), jsx(UserAddress, { walletConnector: walletConnector, userProfile: userProfile }), jsx("div", Object.assign({ className: 'network-not-supported__network-container' }, { children: evmNetworks.length > 1 && (jsx(NetworkPicker, { evmNetworks: evmNetworks, connector: walletConnector, isNetworkPickerOpen: isNetworkPickerOpen, setIsNetworkPickerOpen: setIsNetworkPickerOpen, showNetworkName: true, buttonClassName: 'network-not-supported__network-picker-button', mainClassName: 'network-not-supported__network-picker' })) })), jsxs("div", Object.assign({ className: 'network-not-supported__welcome-container' }, { children: [jsx(Typography, Object.assign({ variant: 'title', color: 'primary', className: 'network-not-supported__welcome-title' }, { children: "Update Network" })), jsx(Typography, Object.assign({ variant: 'body_normal', weight: 'regular', color: 'secondary' }, { children: "Your wallet is not connected to a supported network. Please update before continuing." }))] })), evmNetworks.length === 1 && (jsx(SelectNetworkButton, { onClick: onSelectNetworkButtonClick, networkId: evmNetworks[0].networkId, networkName: evmNetworks[0].vanityName || evmNetworks[0].name, networkIconUrl: evmNetworks[0].iconUrls[0] }))] }))] })));
82
+ const evmNetworks = walletConnector.evmNetworks || [];
83
+ const _isSupportedNetwork = isSupportedNetwork({ network, walletConnector });
84
+ return (jsxs("div", Object.assign({ className: 'network-not-supported', "data-testid": 'network-not-supported' }, { children: [onboardingImageUrl && (jsx("img", { className: 'network-not-supported__main-img', src: onboardingImageUrl, alt: 'onboarding' })), !_isSupportedNetwork && (jsx(ErrorContainer, Object.assign({ variant: 'info', withIcon: false, className: 'network-not-supported__error--not-supported' }, { children: "This network is not available, please update." }))), jsxs("div", Object.assign({ className: 'network-not-supported__content-container' }, { children: [jsx("div", Object.assign({ className: 'network-not-supported__img-container' }, { children: jsx(WalletIcon, { style: { height: 64, width: 64 }, walletName: walletConnector.name }) })), jsx(UserAddress, { walletConnector: walletConnector }), jsx("div", Object.assign({ className: 'network-not-supported__network-container' }, { children: evmNetworks.length > 1 && (jsx(NetworkPicker, { evmNetworks: evmNetworks, connector: walletConnector, isNetworkPickerOpen: isNetworkPickerOpen, setIsNetworkPickerOpen: setIsNetworkPickerOpen, showNetworkName: true, buttonClassName: 'network-not-supported__network-picker-button', mainClassName: 'network-not-supported__network-picker' })) })), jsxs("div", Object.assign({ className: 'network-not-supported__welcome-container' }, { children: [jsx(Typography, Object.assign({ variant: 'title', color: 'primary', className: 'network-not-supported__welcome-title' }, { children: "Update Network" })), jsx(Typography, Object.assign({ variant: 'body_normal', weight: 'regular', color: 'secondary' }, { children: "Your wallet is not connected to a supported network. Please update before continuing." }))] })), evmNetworks.length === 1 && (jsx(SelectNetworkButton, { onClick: onSelectNetworkButtonClick, networkId: evmNetworks[0].networkId, networkName: evmNetworks[0].vanityName || evmNetworks[0].name, networkIconUrl: evmNetworks[0].iconUrls[0] }))] }))] })));
84
85
  };
85
86
 
86
87
  export { NetworkNotSupported };
@@ -47,14 +47,13 @@ require('../../components/Popper/PopperContext/PopperContext.cjs');
47
47
  require('formik');
48
48
  require('yup');
49
49
  require('../../components/InlineWidget/InlineWidget.cjs');
50
- var useUpdateUserProfileByJWTCallback = require('../../utils/hooks/useUpdateUserProfileByJWTCallback/useUpdateUserProfileByJWTCallback.cjs');
50
+ var useApplyWalletConnectorNetwork = require('../../utils/hooks/useApplyWalletConnectorNetwork/useApplyWalletConnectorNetwork.cjs');
51
51
 
52
52
  // The component notifies the user about the required manual network change,
53
53
  // as the wallet does not support programmatic network change.
54
54
  const NetworkNotSupportedSwitchManual = () => {
55
55
  var _a, _b;
56
- const { user, onboardingOnlyJwt, selectedWalletConnector: walletConnector, } = useInternalDynamicContext.useInternalDynamicContext();
57
- const { updateUserProfileByJWT } = useUpdateUserProfileByJWTCallback.useUpdateUserProfileByJWTCallback();
56
+ const { user, selectedWalletConnector: walletConnector } = useInternalDynamicContext.useInternalDynamicContext();
58
57
  const finishConnectAndSign = useConnectAndSign.useConnectAndSign();
59
58
  const onChainChange = React.useCallback((network) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
60
59
  if (isSupportedNetwork.isSupportedNetwork({ network, walletConnector })) {
@@ -64,15 +63,12 @@ const NetworkNotSupportedSwitchManual = () => {
64
63
  }
65
64
  }),
66
65
  // eslint-disable-next-line react-hooks/exhaustive-deps
67
- [
68
- finishConnectAndSign,
69
- onboardingOnlyJwt,
70
- updateUserProfileByJWT,
71
- walletConnector,
72
- ]);
66
+ [finishConnectAndSign, walletConnector]);
73
67
  // We can't listen on the network defined in the context,
74
68
  // because events on the primaryWallet are defined after message is signed.
75
69
  useWalletConnectorEvents.useWalletConnectorEvents(walletConnector, { onChainChange });
70
+ // Applies walletConnectors network to the context data
71
+ useApplyWalletConnectorNetwork.useApplyWalletConnectorNetwork({ walletConnector });
76
72
  const iconSize = 80;
77
73
  const icon = (jsxRuntime.jsx(walletBook.WalletIcon, { walletName: walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.name, style: {
78
74
  height: pixelToRem.pixelToRem(iconSize * IconWithSpinner.iconRatio),
@@ -43,14 +43,13 @@ import '../../components/Popper/PopperContext/PopperContext.js';
43
43
  import 'formik';
44
44
  import 'yup';
45
45
  import '../../components/InlineWidget/InlineWidget.js';
46
- import { useUpdateUserProfileByJWTCallback } from '../../utils/hooks/useUpdateUserProfileByJWTCallback/useUpdateUserProfileByJWTCallback.js';
46
+ import { useApplyWalletConnectorNetwork } from '../../utils/hooks/useApplyWalletConnectorNetwork/useApplyWalletConnectorNetwork.js';
47
47
 
48
48
  // The component notifies the user about the required manual network change,
49
49
  // as the wallet does not support programmatic network change.
50
50
  const NetworkNotSupportedSwitchManual = () => {
51
51
  var _a, _b;
52
- const { user, onboardingOnlyJwt, selectedWalletConnector: walletConnector, } = useInternalDynamicContext();
53
- const { updateUserProfileByJWT } = useUpdateUserProfileByJWTCallback();
52
+ const { user, selectedWalletConnector: walletConnector } = useInternalDynamicContext();
54
53
  const finishConnectAndSign = useConnectAndSign();
55
54
  const onChainChange = useCallback((network) => __awaiter(void 0, void 0, void 0, function* () {
56
55
  if (isSupportedNetwork({ network, walletConnector })) {
@@ -60,15 +59,12 @@ const NetworkNotSupportedSwitchManual = () => {
60
59
  }
61
60
  }),
62
61
  // eslint-disable-next-line react-hooks/exhaustive-deps
63
- [
64
- finishConnectAndSign,
65
- onboardingOnlyJwt,
66
- updateUserProfileByJWT,
67
- walletConnector,
68
- ]);
62
+ [finishConnectAndSign, walletConnector]);
69
63
  // We can't listen on the network defined in the context,
70
64
  // because events on the primaryWallet are defined after message is signed.
71
65
  useWalletConnectorEvents(walletConnector, { onChainChange });
66
+ // Applies walletConnectors network to the context data
67
+ useApplyWalletConnectorNetwork({ walletConnector });
72
68
  const iconSize = 80;
73
69
  const icon = (jsx(WalletIcon, { walletName: walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.name, style: {
74
70
  height: pixelToRem(iconSize * iconRatio),
@@ -20,6 +20,7 @@ require('../../../context/DynamicContext/DynamicContext.cjs');
20
20
  require('@dynamic-labs/multi-wallet');
21
21
  require('../../../components/ShadowDOM/ShadowDOM.cjs');
22
22
  require('../../../context/ThemeContext/ThemeContext.cjs');
23
+ var Icon = require('../../../components/Icon/Icon.cjs');
23
24
  require('react-dom');
24
25
  require('react-focus-lock');
25
26
  require('../../../components/Transition/ZoomTransition/ZoomTransition.cjs');
@@ -41,6 +42,6 @@ require('formik');
41
42
  require('yup');
42
43
  require('../../../components/InlineWidget/InlineWidget.cjs');
43
44
 
44
- const SearchNotFoundMessage = ({ title, subtitle, image, }) => (jsxRuntime.jsxs("div", Object.assign({ className: 'search-instead__container' }, { children: [image && jsxRuntime.jsx("div", { children: image }), jsxRuntime.jsx(Typography.Typography, Object.assign({ color: 'secondary', variant: 'body_small', weight: 'regular' }, { children: title || "Don't see your wallet?" })), jsxRuntime.jsx(Typography.Typography, Object.assign({ color: 'primary', variant: 'button_primary', weight: 'regular' }, { children: subtitle || 'Try search instead' }))] })));
45
+ const SearchNotFoundMessage = ({ title, subtitle, image, }) => (jsxRuntime.jsxs("div", Object.assign({ className: 'search-instead__container' }, { children: [image && (jsxRuntime.jsx(Icon.Icon, Object.assign({ className: 'search-instead__container__image', color: 'text-tertiary' }, { children: image }))), jsxRuntime.jsx(Typography.Typography, Object.assign({ color: 'secondary', variant: 'body_small', weight: 'regular' }, { children: title || "Don't see your wallet?" })), jsxRuntime.jsx(Typography.Typography, Object.assign({ color: 'primary', variant: 'button_primary', weight: 'regular' }, { children: subtitle || 'Try search instead' }))] })));
45
46
 
46
47
  exports.SearchNotFoundMessage = SearchNotFoundMessage;
@@ -1,8 +1,8 @@
1
- import { FC, ReactNode } from 'react';
1
+ import { FC, ReactElement } from 'react';
2
2
  interface Props {
3
3
  title?: string;
4
4
  subtitle?: string;
5
- image?: ReactNode;
5
+ image?: ReactElement;
6
6
  }
7
7
  export declare const SearchNotFoundMessage: FC<Props>;
8
8
  export {};
@@ -16,6 +16,7 @@ import '../../../context/DynamicContext/DynamicContext.js';
16
16
  import '@dynamic-labs/multi-wallet';
17
17
  import '../../../components/ShadowDOM/ShadowDOM.js';
18
18
  import '../../../context/ThemeContext/ThemeContext.js';
19
+ import { Icon } from '../../../components/Icon/Icon.js';
19
20
  import 'react-dom';
20
21
  import 'react-focus-lock';
21
22
  import '../../../components/Transition/ZoomTransition/ZoomTransition.js';
@@ -37,6 +38,6 @@ import 'formik';
37
38
  import 'yup';
38
39
  import '../../../components/InlineWidget/InlineWidget.js';
39
40
 
40
- const SearchNotFoundMessage = ({ title, subtitle, image, }) => (jsxs("div", Object.assign({ className: 'search-instead__container' }, { children: [image && jsx("div", { children: image }), jsx(Typography, Object.assign({ color: 'secondary', variant: 'body_small', weight: 'regular' }, { children: title || "Don't see your wallet?" })), jsx(Typography, Object.assign({ color: 'primary', variant: 'button_primary', weight: 'regular' }, { children: subtitle || 'Try search instead' }))] })));
41
+ const SearchNotFoundMessage = ({ title, subtitle, image, }) => (jsxs("div", Object.assign({ className: 'search-instead__container' }, { children: [image && (jsx(Icon, Object.assign({ className: 'search-instead__container__image', color: 'text-tertiary' }, { children: image }))), jsx(Typography, Object.assign({ color: 'secondary', variant: 'body_small', weight: 'regular' }, { children: title || "Don't see your wallet?" })), jsx(Typography, Object.assign({ color: 'primary', variant: 'button_primary', weight: 'regular' }, { children: subtitle || 'Try search instead' }))] })));
41
42
 
42
43
  export { SearchNotFoundMessage };
@@ -33,7 +33,7 @@ var WalletListItem = require('./WalletListItem/WalletListItem.cjs');
33
33
  localStorage.LocalStorage.setToLS(localStorage$1.WALLET_PICKER_SEARCH_KEY, '');
34
34
  const WalletList = ({ isWalletConnectList = false, }) => {
35
35
  var _a;
36
- const { walletsFilter, signWithEmailWalletName, user, wallets, projectSettings, connectedWallets, defaultNumberOfWalletsToShow, walletsToConnectByChain, } = useInternalDynamicContext.useInternalDynamicContext();
36
+ const { walletsFilter, signWithEmailWalletName, user, wallets, projectSettings, defaultNumberOfWalletsToShow, walletsToConnectByChain, } = useInternalDynamicContext.useInternalDynamicContext();
37
37
  const { walletBook: walletBook$1 } = walletBook.useWalletBookContext();
38
38
  const { error } = ErrorContext.useErrorContext();
39
39
  const { view } = ViewContext.useViewContext();
@@ -78,7 +78,7 @@ const WalletList = ({ isWalletConnectList = false, }) => {
78
78
  };
79
79
  return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", Object.assign({ className: 'wallet-list__container' }, { children: [error && jsxRuntime.jsx(ErrorContainer.ErrorContainer, { children: error }), !projectSettings ? (jsxRuntime.jsx(Skeleton.Skeleton, { className: 'wallet-list__search-skeleton' })) : (isSearchEnabled && (jsxRuntime.jsx(Search.Search, { label: `Search through ${numberOfWallets} wallets...`, value: filterValue, onChange: ({ target: { value } }) => handleFilterValueChange(value), onClickClear: () => handleFilterValueChange('') }))), jsxRuntime.jsxs("div", Object.assign({ className: classNames.classNames('wallet-list__scroll-container', {
80
80
  'wallet-list__scroll-container--full-height': isSearchEnabled,
81
- }), "data-testid": 'wallet-list-scroll-container', ref: walletListScrollRef, onScroll: handleScroll }, { children: [!projectSettings ? (jsxRuntime.jsx(Skeleton.Skeleton, { count: 10, className: 'wallet-list__tile-skeleton' })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [wallets.length === 0 && (jsxRuntime.jsx(ErrorContainer.ErrorContainer, { children: "Oops, no login methods have been configured." })), wallets.length && walletsList.length === 0 ? (jsxRuntime.jsx(SearchNotFoundMessage.SearchNotFoundMessage, { title: 'No wallet found.', subtitle: 'Try seaching for a different wallet', image: jsxRuntime.jsx(noWalletFound.ReactComponent, {}) })) : (walletsList.map((wallet) => (jsxRuntime.jsx(WalletListItem.WalletListItem, { wallet: wallet, connectedWallets: connectedWallets, usingMultiWallet: isUsingMultiWallet, onResetSearchValue: () => handleFilterValueChange('') }, wallet.key))))] })), isSearchEnabled && !filterValue && projectSettings && (jsxRuntime.jsx(SearchNotFoundMessage.SearchNotFoundMessage, {}))] }))] })), noDefaultFooter && (jsxRuntime.jsx("div", { className: classNames.classNames('wallet-list__tiny-footer', {
81
+ }), "data-testid": 'wallet-list-scroll-container', ref: walletListScrollRef, onScroll: handleScroll }, { children: [!projectSettings ? (jsxRuntime.jsx(Skeleton.Skeleton, { count: 10, className: 'wallet-list__tile-skeleton' })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [wallets.length === 0 && (jsxRuntime.jsx(ErrorContainer.ErrorContainer, { children: "Oops, no login methods have been configured." })), wallets.length && walletsList.length === 0 ? (jsxRuntime.jsx(SearchNotFoundMessage.SearchNotFoundMessage, { title: 'No wallet found.', subtitle: 'Try searching for a different wallet', image: jsxRuntime.jsx(noWalletFound.ReactComponent, {}) })) : (walletsList.map((wallet) => (jsxRuntime.jsx(WalletListItem.WalletListItem, { wallet: wallet, usingMultiWallet: isUsingMultiWallet, onResetSearchValue: () => handleFilterValueChange('') }, wallet.key))))] })), isSearchEnabled && !filterValue && projectSettings && (jsxRuntime.jsx(SearchNotFoundMessage.SearchNotFoundMessage, {}))] }))] })), noDefaultFooter && (jsxRuntime.jsx("div", { className: classNames.classNames('wallet-list__tiny-footer', {
82
82
  'wallet-list__tiny-footer--hidden': footerIsVisible,
83
83
  }), "data-testid": 'wallet-list-tiny-footer' }))] }));
84
84
  };
@@ -29,7 +29,7 @@ import { WalletListItem } from './WalletListItem/WalletListItem.js';
29
29
  LocalStorage.setToLS(WALLET_PICKER_SEARCH_KEY, '');
30
30
  const WalletList = ({ isWalletConnectList = false, }) => {
31
31
  var _a;
32
- const { walletsFilter, signWithEmailWalletName, user, wallets, projectSettings, connectedWallets, defaultNumberOfWalletsToShow, walletsToConnectByChain, } = useInternalDynamicContext();
32
+ const { walletsFilter, signWithEmailWalletName, user, wallets, projectSettings, defaultNumberOfWalletsToShow, walletsToConnectByChain, } = useInternalDynamicContext();
33
33
  const { walletBook } = useWalletBookContext();
34
34
  const { error } = useErrorContext();
35
35
  const { view } = useViewContext();
@@ -74,7 +74,7 @@ const WalletList = ({ isWalletConnectList = false, }) => {
74
74
  };
75
75
  return (jsxs(Fragment, { children: [jsxs("div", Object.assign({ className: 'wallet-list__container' }, { children: [error && jsx(ErrorContainer, { children: error }), !projectSettings ? (jsx(Skeleton, { className: 'wallet-list__search-skeleton' })) : (isSearchEnabled && (jsx(Search, { label: `Search through ${numberOfWallets} wallets...`, value: filterValue, onChange: ({ target: { value } }) => handleFilterValueChange(value), onClickClear: () => handleFilterValueChange('') }))), jsxs("div", Object.assign({ className: classNames('wallet-list__scroll-container', {
76
76
  'wallet-list__scroll-container--full-height': isSearchEnabled,
77
- }), "data-testid": 'wallet-list-scroll-container', ref: walletListScrollRef, onScroll: handleScroll }, { children: [!projectSettings ? (jsx(Skeleton, { count: 10, className: 'wallet-list__tile-skeleton' })) : (jsxs(Fragment, { children: [wallets.length === 0 && (jsx(ErrorContainer, { children: "Oops, no login methods have been configured." })), wallets.length && walletsList.length === 0 ? (jsx(SearchNotFoundMessage, { title: 'No wallet found.', subtitle: 'Try seaching for a different wallet', image: jsx(SvgNoWalletFound, {}) })) : (walletsList.map((wallet) => (jsx(WalletListItem, { wallet: wallet, connectedWallets: connectedWallets, usingMultiWallet: isUsingMultiWallet, onResetSearchValue: () => handleFilterValueChange('') }, wallet.key))))] })), isSearchEnabled && !filterValue && projectSettings && (jsx(SearchNotFoundMessage, {}))] }))] })), noDefaultFooter && (jsx("div", { className: classNames('wallet-list__tiny-footer', {
77
+ }), "data-testid": 'wallet-list-scroll-container', ref: walletListScrollRef, onScroll: handleScroll }, { children: [!projectSettings ? (jsx(Skeleton, { count: 10, className: 'wallet-list__tile-skeleton' })) : (jsxs(Fragment, { children: [wallets.length === 0 && (jsx(ErrorContainer, { children: "Oops, no login methods have been configured." })), wallets.length && walletsList.length === 0 ? (jsx(SearchNotFoundMessage, { title: 'No wallet found.', subtitle: 'Try searching for a different wallet', image: jsx(SvgNoWalletFound, {}) })) : (walletsList.map((wallet) => (jsx(WalletListItem, { wallet: wallet, usingMultiWallet: isUsingMultiWallet, onResetSearchValue: () => handleFilterValueChange('') }, wallet.key))))] })), isSearchEnabled && !filterValue && projectSettings && (jsx(SearchNotFoundMessage, {}))] }))] })), noDefaultFooter && (jsx("div", { className: classNames('wallet-list__tiny-footer', {
78
78
  'wallet-list__tiny-footer--hidden': footerIsVisible,
79
79
  }), "data-testid": 'wallet-list-tiny-footer' }))] }));
80
80
  };
@@ -1,7 +1,6 @@
1
1
  import { ReactElement, ReactNode } from 'react';
2
- import { Wallet, WalletOption } from '../../../shared';
2
+ import { WalletOption } from '../../../shared';
3
3
  export type WalletListItemProps = {
4
- connectedWallets: Wallet[];
5
4
  onResetSearchValue?: (newSearchValue: string) => void;
6
5
  tile?: WalletListItemTile;
7
6
  usingMultiWallet: boolean;
@@ -1,22 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var jsxRuntime = require('react/jsx-runtime');
6
- var ThemeContext = require('../../../context/ThemeContext/ThemeContext.cjs');
7
- var Switch = require('../../Switch/Switch.cjs');
8
-
9
- const BrandStyleSwitch = () => {
10
- const { changeBrandStyle, theme } = ThemeContext.useThemeContext();
11
- return (jsxRuntime.jsx(Switch.Switch, { firstButton: {
12
- active: theme.brandStyle === 'bold',
13
- handleButtonClick: () => changeBrandStyle('bold'),
14
- name: 'Bold',
15
- }, secondButton: {
16
- active: theme.brandStyle === 'subtle',
17
- handleButtonClick: () => changeBrandStyle('subtle'),
18
- name: 'Subtle',
19
- } }));
20
- };
21
-
22
- exports.BrandStyleSwitch = BrandStyleSwitch;
@@ -1,2 +0,0 @@
1
- /// <reference types="react" />
2
- export declare const BrandStyleSwitch: () => JSX.Element;
@@ -1,18 +0,0 @@
1
- import { jsx } from 'react/jsx-runtime';
2
- import { useThemeContext } from '../../../context/ThemeContext/ThemeContext.js';
3
- import { Switch } from '../../Switch/Switch.js';
4
-
5
- const BrandStyleSwitch = () => {
6
- const { changeBrandStyle, theme } = useThemeContext();
7
- return (jsx(Switch, { firstButton: {
8
- active: theme.brandStyle === 'bold',
9
- handleButtonClick: () => changeBrandStyle('bold'),
10
- name: 'Bold',
11
- }, secondButton: {
12
- active: theme.brandStyle === 'subtle',
13
- handleButtonClick: () => changeBrandStyle('subtle'),
14
- name: 'Subtle',
15
- } }));
16
- };
17
-
18
- export { BrandStyleSwitch };