@dynamic-labs/sdk-react-core 0.19.0-alpha.4 → 0.19.0-alpha.6

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 (78) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/package.cjs +2 -2
  3. package/package.js +2 -2
  4. package/package.json +9 -9
  5. package/src/lib/components/DynamicConnectButton/DynamicConnectButton.cjs +2 -14
  6. package/src/lib/components/DynamicConnectButton/DynamicConnectButton.js +2 -14
  7. package/src/lib/components/UserProfile/UserProfile.cjs +1 -1
  8. package/src/lib/components/UserProfile/UserProfile.js +1 -1
  9. package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.cjs +1 -1
  10. package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.js +1 -1
  11. package/src/lib/context/DynamicContext/DynamicContext.cjs +1 -1
  12. package/src/lib/context/DynamicContext/DynamicContext.js +1 -1
  13. package/src/lib/context/DynamicContext/helpers.cjs +5 -6
  14. package/src/lib/context/DynamicContext/helpers.d.ts +2 -2
  15. package/src/lib/context/DynamicContext/helpers.js +5 -6
  16. package/src/lib/context/ViewContext/ViewContext.d.ts +1 -1
  17. package/src/lib/layout/DynamicAuthLayout/HelpContent/HelpContent.cjs +2 -1
  18. package/src/lib/layout/DynamicAuthLayout/HelpContent/HelpContent.js +2 -1
  19. package/src/lib/utils/functions/createUserProfile/createUserProfile.cjs +1 -1
  20. package/src/lib/utils/functions/createUserProfile/createUserProfile.js +1 -1
  21. package/src/lib/utils/functions/getDynamicLayoutData/getDynamicLayoutData.cjs +6 -0
  22. package/src/lib/utils/functions/getDynamicLayoutData/getDynamicLayoutData.js +6 -0
  23. package/src/lib/utils/hooks/multiWallet/useSyncPrimaryWallet/useSyncPrimaryWallet.cjs +4 -4
  24. package/src/lib/utils/hooks/multiWallet/useSyncPrimaryWallet/useSyncPrimaryWallet.js +4 -4
  25. package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.cjs +7 -5
  26. package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.js +7 -5
  27. package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.cjs +14 -16
  28. package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.js +15 -17
  29. package/src/lib/utils/hooks/useSocialAccounts/useSocialAccounts.cjs +1 -6
  30. package/src/lib/utils/hooks/useSocialAccounts/useSocialAccounts.js +1 -6
  31. package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.cjs +15 -10
  32. package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.js +15 -10
  33. package/src/lib/views/AccountExistsView/AccountExistsView.cjs +2 -2
  34. package/src/lib/views/AccountExistsView/AccountExistsView.js +2 -2
  35. package/src/lib/views/LoginView/LoginView.cjs +70 -0
  36. package/src/lib/views/LoginView/LoginView.d.ts +2 -0
  37. package/src/lib/views/LoginView/LoginView.js +66 -0
  38. package/src/lib/views/{LoginWithEmailView/components/LoginWithEmailForm/LoginWithEmailForm.cjs → LoginView/components/EmailSignIn/LoginEmailForm.cjs} +6 -11
  39. package/src/lib/views/LoginView/components/EmailSignIn/LoginEmailForm.d.ts +8 -0
  40. package/src/lib/views/{LoginWithEmailView/components/LoginWithEmailForm/LoginWithEmailForm.js → LoginView/components/EmailSignIn/LoginEmailForm.js} +6 -11
  41. package/src/lib/views/LoginView/components/EmailSignIn/index.d.ts +1 -0
  42. package/src/lib/views/LoginView/components/LoginWidget.d.ts +5 -0
  43. package/src/lib/views/LoginView/components/WalletSignIn/ListItemButton/ListItemButton.cjs +65 -0
  44. package/src/lib/views/{LoginWithEmailView/components → LoginView/components/WalletSignIn}/ListItemButton/ListItemButton.d.ts +2 -1
  45. package/src/lib/views/LoginView/components/WalletSignIn/ListItemButton/ListItemButton.js +61 -0
  46. package/src/lib/views/{LoginWithEmailView/components/ListItemButton/ListItemButton.cjs → LoginView/components/WalletSignIn/WalletSignIn.cjs} +7 -19
  47. package/src/lib/views/LoginView/components/WalletSignIn/WalletSignIn.d.ts +7 -0
  48. package/src/lib/views/{LoginWithEmailView/components/ListItemButton/ListItemButton.js → LoginView/components/WalletSignIn/WalletSignIn.js} +8 -20
  49. package/src/lib/views/LoginView/components/WalletSignIn/WalletSimpleSignIn/WalletSimpleSignIn.cjs +47 -0
  50. package/src/lib/views/LoginView/components/WalletSignIn/WalletSimpleSignIn/WalletSimpleSignIn.d.ts +8 -0
  51. package/src/lib/views/LoginView/components/WalletSignIn/WalletSimpleSignIn/WalletSimpleSignIn.js +43 -0
  52. package/src/lib/views/LoginView/components/WalletSignIn/WalletSimpleSignIn/index.d.ts +1 -0
  53. package/src/lib/views/LoginView/components/WalletSignIn/index.d.ts +1 -0
  54. package/src/lib/views/LoginView/components/index.d.ts +3 -0
  55. package/src/lib/views/LoginView/index.d.ts +1 -0
  56. package/src/lib/views/LoginView/useLoginView.cjs +146 -0
  57. package/src/lib/views/LoginView/useLoginView.d.ts +6 -0
  58. package/src/lib/views/LoginView/useLoginView.js +141 -0
  59. package/src/lib/views/WalletList/WalletListItem/WalletListItem.cjs +2 -2
  60. package/src/lib/views/WalletList/WalletListItem/WalletListItem.js +2 -2
  61. package/src/lib/views/WalletList/WalletListItem/WalletListItem.types.d.ts +1 -0
  62. package/src/lib/views/viewToComponentMap.cjs +4 -3
  63. package/src/lib/views/viewToComponentMap.js +4 -3
  64. package/src/lib/views/LoginWithEmailView/LoginWithEmailView.cjs +0 -63
  65. package/src/lib/views/LoginWithEmailView/LoginWithEmailView.d.ts +0 -2
  66. package/src/lib/views/LoginWithEmailView/LoginWithEmailView.js +0 -59
  67. package/src/lib/views/LoginWithEmailView/components/LoginWithEmailForm/LoginWithEmailForm.d.ts +0 -7
  68. package/src/lib/views/LoginWithEmailView/components/LoginWithEmailForm/index.d.ts +0 -1
  69. package/src/lib/views/LoginWithEmailView/components/LoginWithEmailWalletList/LoginWithEmailWalletList.cjs +0 -36
  70. package/src/lib/views/LoginWithEmailView/components/LoginWithEmailWalletList/LoginWithEmailWalletList.d.ts +0 -9
  71. package/src/lib/views/LoginWithEmailView/components/LoginWithEmailWalletList/LoginWithEmailWalletList.js +0 -31
  72. package/src/lib/views/LoginWithEmailView/components/LoginWithEmailWalletList/index.d.ts +0 -1
  73. package/src/lib/views/LoginWithEmailView/index.d.ts +0 -1
  74. /package/src/lib/views/{LoginWithEmailView → LoginView}/components/SocialSignIn/SocialSignIn.cjs +0 -0
  75. /package/src/lib/views/{LoginWithEmailView → LoginView}/components/SocialSignIn/SocialSignIn.d.ts +0 -0
  76. /package/src/lib/views/{LoginWithEmailView → LoginView}/components/SocialSignIn/SocialSignIn.js +0 -0
  77. /package/src/lib/views/{LoginWithEmailView → LoginView}/components/SocialSignIn/index.d.ts +0 -0
  78. /package/src/lib/views/{LoginWithEmailView/components → LoginView/components/WalletSignIn}/ListItemButton/index.d.ts +0 -0
@@ -6,7 +6,6 @@ import { EmailConfirmationWaitingView } from './EmailConfirmationWaitingView/Ema
6
6
  import { EmailUpdate } from './EmailUpdate/EmailUpdate.js';
7
7
  import { EmailVerification } from './EmailVerification/EmailVerification.js';
8
8
  import { EmailWalletOTPVerificationView } from './EmailWalletOTPVerificationView/EmailWalletOTPVerificationView.js';
9
- import { LoginWithEmailView } from './LoginWithEmailView/LoginWithEmailView.js';
10
9
  import { NetworkNotSupported } from './NetworkNotSupported/NetworkNotSupported.js';
11
10
  import { NetworkNotSupportedSwitchManual } from './NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.js';
12
11
  import { NoQrNotInstalledView } from './NoQrNotInstalledView/NoQrNotInstalledView.js';
@@ -27,6 +26,7 @@ import { BridgeNextWalletConnectionView } from './BridgeNextWalletConnectionView
27
26
  import { AccountExistsView } from './AccountExistsView/AccountExistsView.js';
28
27
  import { MergeUserAccountsView } from './MergeUserAccountsView/MergeUserAccountsView.js';
29
28
  import { WalletCannotBeTransferredView } from './WalletCannotBeTransferredView/WalletCannotBeTransferredView.js';
29
+ import { LoginView } from './LoginView/LoginView.js';
30
30
 
31
31
  const viewToComponentMap = {
32
32
  'account-exists': jsx(AccountExistsView, {}),
@@ -39,9 +39,10 @@ const viewToComponentMap = {
39
39
  'collect-user-data-login-with-email': jsx(CollectUserDataViewLoginWithEmail, {}),
40
40
  'email-wallet-otp-verification-view': jsx(EmailWalletOTPVerificationView, {}),
41
41
  'gate-blocked-wallet': jsx(NoAccess, {}),
42
- 'login-with-email-or-wallet': jsx(LoginWithEmailView, {}),
43
- 'login-with-email-or-wallet-full-wallet-list': jsx(WalletList, {}),
42
+ 'login-with-email-or-wallet': jsx(LoginView, {}),
43
+ 'login-with-email-or-wallet-full-wallet-list': jsx(LoginView, {}),
44
44
  'login-with-email-verification': jsx(EmailVerification, {}),
45
+ 'login-with-wallet-only': jsx(LoginView, {}),
45
46
  'merge-user-accounts': jsx(MergeUserAccountsView, {}),
46
47
  'network-not-supported': jsx(NetworkNotSupported, {}),
47
48
  'network-not-supported-manual': jsx(NetworkNotSupportedSwitchManual, {}),
@@ -1,63 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var jsxRuntime = require('react/jsx-runtime');
6
- var walletBook = require('@dynamic-labs/wallet-book');
7
- var ErrorContext = require('../../context/ErrorContext/ErrorContext.cjs');
8
- require('@dynamic-labs/sdk-api');
9
- require('../../shared/logger.cjs');
10
- require('@dynamic-labs/iconic');
11
- require('@dynamic-labs/wallet-connector-core');
12
- require('../../context/ViewContext/ViewContext.cjs');
13
- require('react');
14
- var isDisplayOrderPriorityForWeb2 = require('../../shared/utils/functions/isDisplayOrderPriorityForWeb2/isDisplayOrderPriorityForWeb2.cjs');
15
- require('@dynamic-labs/utils');
16
- var localStorage$1 = require('../../utils/constants/localStorage.cjs');
17
- require('../../utils/constants/colors.cjs');
18
- var localStorage = require('../../shared/utils/classes/storage/localStorage.cjs');
19
- require('ethers');
20
- require('../../shared/consts/index.cjs');
21
- var ErrorContainer = require('../../components/ErrorContainer/ErrorContainer.cjs');
22
- var Divider = require('../../components/Divider/Divider.cjs');
23
- var useInternalDynamicContext = require('../../context/DynamicContext/useInternalDynamicContext.cjs');
24
- var classNames = require('../../utils/functions/classNames/classNames.cjs');
25
- var walletListBuilder = require('../../utils/functions/walletListBuilder/walletListBuilder.cjs');
26
- var SocialRedirectContext = require('../../context/SocialRedirectContext/SocialRedirectContext.cjs');
27
- var useAuthLayoutChecks = require('../../utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.cjs');
28
- var LoginWithEmailForm = require('./components/LoginWithEmailForm/LoginWithEmailForm.cjs');
29
- var LoginWithEmailWalletList = require('./components/LoginWithEmailWalletList/LoginWithEmailWalletList.cjs');
30
- var SocialSignIn = require('./components/SocialSignIn/SocialSignIn.cjs');
31
-
32
- const LoginWithEmailView = () => {
33
- var _a;
34
- const { error } = ErrorContext.useErrorContext();
35
- const { authorizationViewDisplayOrder, wallets, projectSettings, walletsFilter, signWithEmailWalletName, loginWithEmail, } = useInternalDynamicContext.useInternalDynamicContext();
36
- const { walletBook: walletBook$1 } = walletBook.useWalletBookContext();
37
- const { showToSFooter } = useAuthLayoutChecks.useAuthLayoutChecks();
38
- const { enabledSocialProviders } = SocialRedirectContext.useSocialRedirectContext();
39
- const { numberOfWallets, walletsList } = walletListBuilder.walletListBuilder({
40
- groupWallets: true,
41
- inputList: wallets,
42
- isWalletConnectList: false,
43
- lastUsedWalletName: localStorage.LocalStorage.getFromLS(localStorage$1.LAST_USED_WALLET),
44
- loginWithEmail,
45
- numberOfWalletsToShow: LoginWithEmailWalletList.NUMBER_OF_WALLETS,
46
- searchFilter: undefined,
47
- signWithEmailWalletName,
48
- walletBook: walletBook$1,
49
- walletsFilter,
50
- });
51
- const isWeb2Priority = isDisplayOrderPriorityForWeb2.isDisplayOrderPriorityForWeb2(authorizationViewDisplayOrder);
52
- const dividerText = isWeb2Priority
53
- ? 'Or continue with a wallet'
54
- : 'Or continue with';
55
- return (jsxRuntime.jsxs("div", Object.assign({ className: 'login-with-email__container' }, { children: [error && jsxRuntime.jsx(ErrorContainer.ErrorContainer, { children: error }), jsxRuntime.jsxs("div", Object.assign({ className: classNames.classNames('login-with-email__scroll', {
56
- 'login-with-email__scroll--email-first': isWeb2Priority,
57
- 'login-with-email__scroll--with-footer': showToSFooter,
58
- }), "data-testid": 'login-with-email-scroll' }, { children: [numberOfWallets &&
59
- walletsList.length &&
60
- !((_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.design.modal) === null || _a === void 0 ? void 0 : _a.emailOnly) ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(LoginWithEmailWalletList.LoginWithEmailWalletList, { walletsList: walletsList, numberOfWallets: numberOfWallets }), jsxRuntime.jsx(Divider.Divider, { text: dividerText })] })) : null, jsxRuntime.jsxs("div", Object.assign({ className: 'login-with-email__scroll__web2' }, { children: [jsxRuntime.jsx(LoginWithEmailForm.LoginWithEmailForm, {}), enabledSocialProviders.length > 0 && jsxRuntime.jsx(SocialSignIn.SocialSignIn, {})] }))] }))] })));
61
- };
62
-
63
- exports.LoginWithEmailView = LoginWithEmailView;
@@ -1,2 +0,0 @@
1
- /// <reference types="react" />
2
- export declare const LoginWithEmailView: () => JSX.Element;
@@ -1,59 +0,0 @@
1
- import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
2
- import { useWalletBookContext } from '@dynamic-labs/wallet-book';
3
- import { useErrorContext } from '../../context/ErrorContext/ErrorContext.js';
4
- import '@dynamic-labs/sdk-api';
5
- import '../../shared/logger.js';
6
- import '@dynamic-labs/iconic';
7
- import '@dynamic-labs/wallet-connector-core';
8
- import '../../context/ViewContext/ViewContext.js';
9
- import 'react';
10
- import { isDisplayOrderPriorityForWeb2 } from '../../shared/utils/functions/isDisplayOrderPriorityForWeb2/isDisplayOrderPriorityForWeb2.js';
11
- import '@dynamic-labs/utils';
12
- import { LAST_USED_WALLET } from '../../utils/constants/localStorage.js';
13
- import '../../utils/constants/colors.js';
14
- import { LocalStorage } from '../../shared/utils/classes/storage/localStorage.js';
15
- import 'ethers';
16
- import '../../shared/consts/index.js';
17
- import { ErrorContainer } from '../../components/ErrorContainer/ErrorContainer.js';
18
- import { Divider } from '../../components/Divider/Divider.js';
19
- import { useInternalDynamicContext } from '../../context/DynamicContext/useInternalDynamicContext.js';
20
- import { classNames } from '../../utils/functions/classNames/classNames.js';
21
- import { walletListBuilder } from '../../utils/functions/walletListBuilder/walletListBuilder.js';
22
- import { useSocialRedirectContext } from '../../context/SocialRedirectContext/SocialRedirectContext.js';
23
- import { useAuthLayoutChecks } from '../../utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.js';
24
- import { LoginWithEmailForm } from './components/LoginWithEmailForm/LoginWithEmailForm.js';
25
- import { NUMBER_OF_WALLETS, LoginWithEmailWalletList } from './components/LoginWithEmailWalletList/LoginWithEmailWalletList.js';
26
- import { SocialSignIn } from './components/SocialSignIn/SocialSignIn.js';
27
-
28
- const LoginWithEmailView = () => {
29
- var _a;
30
- const { error } = useErrorContext();
31
- const { authorizationViewDisplayOrder, wallets, projectSettings, walletsFilter, signWithEmailWalletName, loginWithEmail, } = useInternalDynamicContext();
32
- const { walletBook } = useWalletBookContext();
33
- const { showToSFooter } = useAuthLayoutChecks();
34
- const { enabledSocialProviders } = useSocialRedirectContext();
35
- const { numberOfWallets, walletsList } = walletListBuilder({
36
- groupWallets: true,
37
- inputList: wallets,
38
- isWalletConnectList: false,
39
- lastUsedWalletName: LocalStorage.getFromLS(LAST_USED_WALLET),
40
- loginWithEmail,
41
- numberOfWalletsToShow: NUMBER_OF_WALLETS,
42
- searchFilter: undefined,
43
- signWithEmailWalletName,
44
- walletBook,
45
- walletsFilter,
46
- });
47
- const isWeb2Priority = isDisplayOrderPriorityForWeb2(authorizationViewDisplayOrder);
48
- const dividerText = isWeb2Priority
49
- ? 'Or continue with a wallet'
50
- : 'Or continue with';
51
- return (jsxs("div", Object.assign({ className: 'login-with-email__container' }, { children: [error && jsx(ErrorContainer, { children: error }), jsxs("div", Object.assign({ className: classNames('login-with-email__scroll', {
52
- 'login-with-email__scroll--email-first': isWeb2Priority,
53
- 'login-with-email__scroll--with-footer': showToSFooter,
54
- }), "data-testid": 'login-with-email-scroll' }, { children: [numberOfWallets &&
55
- walletsList.length &&
56
- !((_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.design.modal) === null || _a === void 0 ? void 0 : _a.emailOnly) ? (jsxs(Fragment, { children: [jsx(LoginWithEmailWalletList, { walletsList: walletsList, numberOfWallets: numberOfWallets }), jsx(Divider, { text: dividerText })] })) : null, jsxs("div", Object.assign({ className: 'login-with-email__scroll__web2' }, { children: [jsx(LoginWithEmailForm, {}), enabledSocialProviders.length > 0 && jsx(SocialSignIn, {})] }))] }))] })));
57
- };
58
-
59
- export { LoginWithEmailView };
@@ -1,7 +0,0 @@
1
- /// <reference types="react" />
2
- export declare const EMAIL_REGEX: RegExp;
3
- type Props = {
4
- currentEmail?: string;
5
- };
6
- export declare const LoginWithEmailForm: ({ currentEmail }: Props) => JSX.Element;
7
- export {};
@@ -1 +0,0 @@
1
- export { LoginWithEmailForm } from './LoginWithEmailForm';
@@ -1,36 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var jsxRuntime = require('react/jsx-runtime');
6
- var Skeleton = require('../../../../components/Skeleton/Skeleton.cjs');
7
- var useInternalDynamicContext = require('../../../../context/DynamicContext/useInternalDynamicContext.cjs');
8
- var ViewContext = require('../../../../context/ViewContext/ViewContext.cjs');
9
- require('@dynamic-labs/sdk-api');
10
- require('../../../../shared/logger.cjs');
11
- require('@dynamic-labs/iconic');
12
- require('@dynamic-labs/wallet-connector-core');
13
- require('react');
14
- require('@dynamic-labs/wallet-book');
15
- require('@dynamic-labs/utils');
16
- var localStorage$1 = require('../../../../utils/constants/localStorage.cjs');
17
- require('../../../../utils/constants/colors.cjs');
18
- var localStorage = require('../../../../shared/utils/classes/storage/localStorage.cjs');
19
- require('ethers');
20
- require('../../../../shared/consts/index.cjs');
21
- var WalletListItem = require('../../../WalletList/WalletListItem/WalletListItem.cjs');
22
- var ListItemButton = require('../ListItemButton/ListItemButton.cjs');
23
-
24
- const NUMBER_OF_WALLETS = 3;
25
- const LoginWithEmailWalletList = ({ walletsList, numberOfWallets, }) => {
26
- const { setView } = ViewContext.useViewContext();
27
- const { projectSettings } = useInternalDynamicContext.useInternalDynamicContext();
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) => {
30
- var _a;
31
- return (jsxRuntime.jsx(WalletListItem.WalletListItem, { wallet: wallet, usingMultiWallet: isUsingMultiWallet }, wallet.key + ((_a = wallet.groupedWallets) === null || _a === void 0 ? void 0 : _a.length)));
32
- }), jsxRuntime.jsx(ListItemButton.ListItemButton, { text: 'View all wallets', onClick: () => setView('login-with-email-or-wallet-full-wallet-list'), numberOfWallets: numberOfWallets })] })));
33
- };
34
-
35
- exports.LoginWithEmailWalletList = LoginWithEmailWalletList;
36
- exports.NUMBER_OF_WALLETS = NUMBER_OF_WALLETS;
@@ -1,9 +0,0 @@
1
- /// <reference types="react" />
2
- import { WalletOption } from '../../../../shared';
3
- export declare const NUMBER_OF_WALLETS = 3;
4
- type Props = {
5
- numberOfWallets: number;
6
- walletsList: WalletOption[];
7
- };
8
- export declare const LoginWithEmailWalletList: ({ walletsList, numberOfWallets, }: Props) => JSX.Element;
9
- export {};
@@ -1,31 +0,0 @@
1
- import { jsx, jsxs } from 'react/jsx-runtime';
2
- import { Skeleton } from '../../../../components/Skeleton/Skeleton.js';
3
- import { useInternalDynamicContext } from '../../../../context/DynamicContext/useInternalDynamicContext.js';
4
- import { useViewContext } from '../../../../context/ViewContext/ViewContext.js';
5
- import '@dynamic-labs/sdk-api';
6
- import '../../../../shared/logger.js';
7
- import '@dynamic-labs/iconic';
8
- import '@dynamic-labs/wallet-connector-core';
9
- import 'react';
10
- import '@dynamic-labs/wallet-book';
11
- import '@dynamic-labs/utils';
12
- import { AUTH_USER } from '../../../../utils/constants/localStorage.js';
13
- import '../../../../utils/constants/colors.js';
14
- import { LocalStorage } from '../../../../shared/utils/classes/storage/localStorage.js';
15
- import 'ethers';
16
- import '../../../../shared/consts/index.js';
17
- import { WalletListItem } from '../../../WalletList/WalletListItem/WalletListItem.js';
18
- import { ListItemButton } from '../ListItemButton/ListItemButton.js';
19
-
20
- const NUMBER_OF_WALLETS = 3;
21
- const LoginWithEmailWalletList = ({ walletsList, numberOfWallets, }) => {
22
- const { setView } = useViewContext();
23
- const { projectSettings } = useInternalDynamicContext();
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) => {
26
- var _a;
27
- return (jsx(WalletListItem, { wallet: wallet, usingMultiWallet: isUsingMultiWallet }, wallet.key + ((_a = wallet.groupedWallets) === null || _a === void 0 ? void 0 : _a.length)));
28
- }), jsx(ListItemButton, { text: 'View all wallets', onClick: () => setView('login-with-email-or-wallet-full-wallet-list'), numberOfWallets: numberOfWallets })] })));
29
- };
30
-
31
- export { LoginWithEmailWalletList, NUMBER_OF_WALLETS };
@@ -1 +0,0 @@
1
- export { LoginWithEmailWalletList } from './LoginWithEmailWalletList';
@@ -1 +0,0 @@
1
- export { LoginWithEmailView } from './LoginWithEmailView';