@dynamic-labs/sdk-react-core 2.2.6 → 2.2.8
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.
- package/CHANGELOG.md +18 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +13 -13
- package/src/lib/components/NetworkPicker/components/EvmNetworkControl/EvmNetworkControl.cjs +4 -5
- package/src/lib/components/NetworkPicker/components/EvmNetworkControl/EvmNetworkControl.js +4 -5
- package/src/lib/components/QrCodeWrapper/QrCodeContainer/QrCodeContainer.cjs +1 -1
- package/src/lib/components/QrCodeWrapper/QrCodeContainer/QrCodeContainer.js +1 -1
- package/src/lib/components/UserProfile/UserProfile.cjs +12 -5
- package/src/lib/components/UserProfile/UserProfile.js +12 -5
- package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.cjs +1 -1
- package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.js +1 -1
- package/src/lib/context/DynamicContext/types/index.d.ts +1 -0
- package/src/lib/locale/en/translation.cjs +6 -0
- package/src/lib/locale/en/translation.d.ts +6 -0
- package/src/lib/locale/en/translation.js +6 -0
- package/src/lib/shared/utils/functions/shortenEmail/shortenEmail.d.ts +0 -6
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/hooks/useNetworkNotSupported/useNetworkNotSupported.cjs +43 -42
- package/src/lib/utils/hooks/useNetworkNotSupported/useNetworkNotSupported.js +43 -42
- package/src/lib/utils/hooks/useWalletConnectorNetwork/useWalletConnectorNetwork.cjs +14 -7
- package/src/lib/utils/hooks/useWalletConnectorNetwork/useWalletConnectorNetwork.d.ts +6 -1
- package/src/lib/utils/hooks/useWalletConnectorNetwork/useWalletConnectorNetwork.js +14 -7
- package/src/lib/views/CaptchaVerifyUser/CaptchaVerifyUser.cjs +1 -1
- package/src/lib/views/CaptchaVerifyUser/CaptchaVerifyUser.js +1 -1
- package/src/lib/views/CollectUserDataView/CollectUserDataView.cjs +1 -1
- package/src/lib/views/CollectUserDataView/CollectUserDataView.js +1 -1
- package/src/lib/views/EmailConfirmationWaitingView/EmailConfirmationWaitingView.cjs +1 -1
- package/src/lib/views/EmailConfirmationWaitingView/EmailConfirmationWaitingView.js +1 -1
- package/src/lib/views/EmailVerification/EmailVerification.cjs +1 -1
- package/src/lib/views/EmailVerification/EmailVerification.js +1 -1
- package/src/lib/views/LoginView/sections/WalletSignInSection/ListItemButton/ListItemButton.cjs +1 -1
- package/src/lib/views/LoginView/sections/WalletSignInSection/ListItemButton/ListItemButton.js +1 -1
- package/src/lib/views/Passkey/PasskeyRecovery/BundleValidation/PasskeyBundleRecovery.cjs +1 -1
- package/src/lib/views/Passkey/PasskeyRecovery/BundleValidation/PasskeyBundleRecovery.js +1 -1
- package/src/lib/views/SelectHardwareWalletView/SelectHardwareWalletView.cjs +1 -1
- package/src/lib/views/SelectHardwareWalletView/SelectHardwareWalletView.js +1 -1
- package/src/lib/views/SelectWalletInWalletGroupView/components/WalletGroupItem/WalletGroupItem.cjs +1 -1
- package/src/lib/views/SelectWalletInWalletGroupView/components/WalletGroupItem/WalletGroupItem.js +1 -1
- package/src/lib/views/SocialRedirectView/SocialRedirectView.cjs +1 -1
- package/src/lib/views/SocialRedirectView/SocialRedirectView.js +1 -1
- package/src/lib/views/UserFieldEditorView/UserFieldEditorView.cjs +1 -1
- package/src/lib/views/UserFieldEditorView/UserFieldEditorView.js +1 -1
- package/src/lib/views/WalletGroupView/components/WalletGroupItem/WalletGroupItem.cjs +1 -1
- package/src/lib/views/WalletGroupView/components/WalletGroupItem/WalletGroupItem.js +1 -1
- package/src/lib/views/WalletList/WalletListItem/WalletListItem.cjs +1 -1
- package/src/lib/views/WalletList/WalletListItem/WalletListItem.js +1 -1
- package/src/lib/views/WalletRedirectView/WalletRedirectView.cjs +1 -1
- package/src/lib/views/WalletRedirectView/WalletRedirectView.js +1 -1
- package/src/lib/widgets/DynamicWidget/components/AccountControl/AccountControl.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/components/AccountControl/AccountControl.js +1 -1
- package/src/lib/widgets/DynamicWidget/prompts/DetectedNewWalletModal/DetectedNewWalletModal.cjs +10 -7
- package/src/lib/widgets/DynamicWidget/prompts/DetectedNewWalletModal/DetectedNewWalletModal.js +10 -7
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchOrUseActiveAccountView/SwitchOrUseActiveAccountView.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchOrUseActiveAccountView/SwitchOrUseActiveAccountView.js +1 -1
- package/src/lib/widgets/DynamicWidget/views/WalletsView/WalletsView.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/views/WalletsView/WalletsView.js +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,22 @@
|
|
|
1
1
|
|
|
2
|
+
### [2.2.8](https://github.com/dynamic-labs/DynamicAuth/compare/v2.2.7...v2.2.8) (2024-07-01)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
* show connected network name when icon url is missing ([#6191](https://github.com/dynamic-labs/DynamicAuth/issues/6191)) ([#6193](https://github.com/dynamic-labs/DynamicAuth/issues/6193)) ([ad60062](https://github.com/dynamic-labs/DynamicAuth/commit/ad60062e930c6174d9516f49899722271a918414))
|
|
8
|
+
* show ledger toggle when linking wallet ([#6202](https://github.com/dynamic-labs/DynamicAuth/issues/6202)) ([#6203](https://github.com/dynamic-labs/DynamicAuth/issues/6203)) ([d689f41](https://github.com/dynamic-labs/DynamicAuth/commit/d689f4138570610ceee16bd2167d40c0d0c088c7))
|
|
9
|
+
* stop sending double sign request on network switch ([#6220](https://github.com/dynamic-labs/DynamicAuth/issues/6220)) ([e1dd446](https://github.com/dynamic-labs/DynamicAuth/commit/e1dd4468dc28b92ba3f8465e509d8fe762223d4c))
|
|
10
|
+
* update formatting of phantom bitcoin publickey ([#6211](https://github.com/dynamic-labs/DynamicAuth/issues/6211)) ([044e4bc](https://github.com/dynamic-labs/DynamicAuth/commit/044e4bce8180d7125d0437132b7deb4ae80db031))
|
|
11
|
+
|
|
12
|
+
### [2.2.7](https://github.com/dynamic-labs/DynamicAuth/compare/v2.2.6...v2.2.7) (2024-06-28)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* coinbase smart wallet better handling in iframes ([#6190](https://github.com/dynamic-labs/DynamicAuth/issues/6190)) ([26530e6](https://github.com/dynamic-labs/DynamicAuth/commit/26530e6e7e368c83ade97ae4edd0de01944825b9))
|
|
18
|
+
* show user wallet in profile view on single wallet mode even if it's not primary ([#6194](https://github.com/dynamic-labs/DynamicAuth/issues/6194)) ([070db58](https://github.com/dynamic-labs/DynamicAuth/commit/070db581f487b0e9a308d99497f63679f61fba7b))
|
|
19
|
+
|
|
2
20
|
### [2.2.6](https://github.com/dynamic-labs/DynamicAuth/compare/v2.2.5...v2.2.6) (2024-06-26)
|
|
3
21
|
|
|
4
22
|
|
package/package.cjs
CHANGED
package/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/sdk-react-core",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.8",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/dynamic-labs/dynamic-auth.git",
|
|
@@ -17,18 +17,18 @@
|
|
|
17
17
|
"react-i18next": "13.5.0",
|
|
18
18
|
"yup": "0.32.11",
|
|
19
19
|
"react-international-phone": "4.2.5",
|
|
20
|
-
"@dynamic-labs/iconic": "2.2.
|
|
21
|
-
"@dynamic-labs/logger": "2.2.
|
|
22
|
-
"@dynamic-labs/multi-wallet": "2.2.
|
|
23
|
-
"@dynamic-labs/rpc-provider-ethereum": "2.2.
|
|
24
|
-
"@dynamic-labs/rpc-provider-solana": "2.2.
|
|
25
|
-
"@dynamic-labs/rpc-providers": "2.2.
|
|
26
|
-
"@dynamic-labs/store": "2.2.
|
|
27
|
-
"@dynamic-labs/types": "2.2.
|
|
28
|
-
"@dynamic-labs/utils": "2.2.
|
|
29
|
-
"@dynamic-labs/viem-utils": "2.2.
|
|
30
|
-
"@dynamic-labs/wallet-book": "2.2.
|
|
31
|
-
"@dynamic-labs/wallet-connector-core": "2.2.
|
|
20
|
+
"@dynamic-labs/iconic": "2.2.8",
|
|
21
|
+
"@dynamic-labs/logger": "2.2.8",
|
|
22
|
+
"@dynamic-labs/multi-wallet": "2.2.8",
|
|
23
|
+
"@dynamic-labs/rpc-provider-ethereum": "2.2.8",
|
|
24
|
+
"@dynamic-labs/rpc-provider-solana": "2.2.8",
|
|
25
|
+
"@dynamic-labs/rpc-providers": "2.2.8",
|
|
26
|
+
"@dynamic-labs/store": "2.2.8",
|
|
27
|
+
"@dynamic-labs/types": "2.2.8",
|
|
28
|
+
"@dynamic-labs/utils": "2.2.8",
|
|
29
|
+
"@dynamic-labs/viem-utils": "2.2.8",
|
|
30
|
+
"@dynamic-labs/wallet-book": "2.2.8",
|
|
31
|
+
"@dynamic-labs/wallet-connector-core": "2.2.8",
|
|
32
32
|
"eventemitter3": "5.0.1"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
@@ -8,7 +8,6 @@ var utils = require('@dynamic-labs/utils');
|
|
|
8
8
|
require('@dynamic-labs/iconic');
|
|
9
9
|
require('../../../../context/ViewContext/ViewContext.cjs');
|
|
10
10
|
require('react');
|
|
11
|
-
var error = require('../../../../shared/assets/error.cjs');
|
|
12
11
|
var stroke = require('../../../../shared/assets/stroke.cjs');
|
|
13
12
|
var classNames = require('../../../../utils/functions/classNames/classNames.cjs');
|
|
14
13
|
require('../../../Accordion/components/AccordionItem/AccordionItem.cjs');
|
|
@@ -85,7 +84,7 @@ require('@hcaptcha/react-hcaptcha');
|
|
|
85
84
|
require('../../../../context/IpConfigurationContext/IpConfigurationContext.cjs');
|
|
86
85
|
|
|
87
86
|
const EvmNetworkControl = ({ evmNetworks, className = '', activeClassName = '', network, walletConnector, isOpen, setIsOpen, showNetworkName = false, }) => {
|
|
88
|
-
var _a
|
|
87
|
+
var _a;
|
|
89
88
|
const currentEvmNetwork = evmNetworks === null || evmNetworks === void 0 ? void 0 : evmNetworks.find((element) => network && element.chainId === utils.parseChainId(network));
|
|
90
89
|
if (evmNetworks && !evmNetworks.length) {
|
|
91
90
|
return (jsxRuntime.jsx("div", { "data-testid": 'EvmNetworkControl', className: classNames.classNames('evm-network-control__container evm-network-control__container--error', className), children: jsxRuntime.jsx(UnsupportedNetwork.UnsupportedNetwork, { showMsg: showNetworkName }) }));
|
|
@@ -103,9 +102,9 @@ const EvmNetworkControl = ({ evmNetworks, className = '', activeClassName = '',
|
|
|
103
102
|
'evm-network-control__arrow-icon--active': isOpen,
|
|
104
103
|
}), children: jsxRuntime.jsx(stroke.ReactComponent, {}) })] }));
|
|
105
104
|
}
|
|
106
|
-
return (jsxRuntime.
|
|
105
|
+
return (jsxRuntime.jsxs("div", { "data-testid": 'EvmNetworkControl', onClick: () => network && setIsOpen(!isOpen), className: classNames.classNames('evm-network-control__container', {
|
|
107
106
|
[activeClassName]: isOpen,
|
|
108
|
-
}, className), children: currentEvmNetwork.
|
|
107
|
+
}, className), children: [currentEvmNetwork.iconUrls.length > 0 && (jsxRuntime.jsx(Icon.Icon, { size: 'small', children: jsxRuntime.jsx("img", { src: currentEvmNetwork.iconUrls[0], alt: `${currentEvmNetwork.name} icon` }) })), showNetworkName && (jsxRuntime.jsx(Typography.Typography, { className: 'evm-network-control__network-name', as: 'span', variant: 'body_small', children: currentEvmNetwork.vanityName || currentEvmNetwork.name }))] }));
|
|
109
108
|
}
|
|
110
109
|
return (jsxRuntime.jsxs("button", { "data-testid": 'EvmNetworkControl', type: 'button', onClick: (e) => {
|
|
111
110
|
e.stopPropagation();
|
|
@@ -114,7 +113,7 @@ const EvmNetworkControl = ({ evmNetworks, className = '', activeClassName = '',
|
|
|
114
113
|
[activeClassName]: isOpen,
|
|
115
114
|
'evm-network-control__container': Boolean(walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.supportsNetworkSwitching()),
|
|
116
115
|
'evm-network-control__container--error': !(currentEvmNetwork === null || currentEvmNetwork === void 0 ? void 0 : currentEvmNetwork.name),
|
|
117
|
-
}), children: [(currentEvmNetwork === null || currentEvmNetwork === void 0 ? void 0 : currentEvmNetwork.name) ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
116
|
+
}), children: [(currentEvmNetwork === null || currentEvmNetwork === void 0 ? void 0 : currentEvmNetwork.name) ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [((_a = currentEvmNetwork === null || currentEvmNetwork === void 0 ? void 0 : currentEvmNetwork.iconUrls) === null || _a === void 0 ? void 0 : _a[0]) && (jsxRuntime.jsx(Icon.Icon, { size: 'small', children: jsxRuntime.jsx("img", { src: currentEvmNetwork.iconUrls[0], alt: `${currentEvmNetwork.name} icon` }) })), showNetworkName && (jsxRuntime.jsx(Typography.Typography, { className: 'evm-network-control__network-name', as: 'span', variant: 'body_small', children: currentEvmNetwork.vanityName || currentEvmNetwork.name }))] })) : (jsxRuntime.jsx(UnsupportedNetwork.UnsupportedNetwork, { showMsg: showNetworkName })), evmNetworks && evmNetworks.length > 1 && (jsxRuntime.jsx(Icon.Icon, { color: 'text-primary', size: 'small', className: classNames.classNames('evm-network-control__arrow-icon', {
|
|
118
117
|
'evm-network-control__arrow-icon--active': isOpen,
|
|
119
118
|
}), children: jsxRuntime.jsx(stroke.ReactComponent, {}) }))] }));
|
|
120
119
|
};
|
|
@@ -4,7 +4,6 @@ import { parseChainId } from '@dynamic-labs/utils';
|
|
|
4
4
|
import '@dynamic-labs/iconic';
|
|
5
5
|
import '../../../../context/ViewContext/ViewContext.js';
|
|
6
6
|
import 'react';
|
|
7
|
-
import { ReactComponent as SvgError } from '../../../../shared/assets/error.js';
|
|
8
7
|
import { ReactComponent as SvgStroke } from '../../../../shared/assets/stroke.js';
|
|
9
8
|
import { classNames } from '../../../../utils/functions/classNames/classNames.js';
|
|
10
9
|
import '../../../Accordion/components/AccordionItem/AccordionItem.js';
|
|
@@ -81,7 +80,7 @@ import '@hcaptcha/react-hcaptcha';
|
|
|
81
80
|
import '../../../../context/IpConfigurationContext/IpConfigurationContext.js';
|
|
82
81
|
|
|
83
82
|
const EvmNetworkControl = ({ evmNetworks, className = '', activeClassName = '', network, walletConnector, isOpen, setIsOpen, showNetworkName = false, }) => {
|
|
84
|
-
var _a
|
|
83
|
+
var _a;
|
|
85
84
|
const currentEvmNetwork = evmNetworks === null || evmNetworks === void 0 ? void 0 : evmNetworks.find((element) => network && element.chainId === parseChainId(network));
|
|
86
85
|
if (evmNetworks && !evmNetworks.length) {
|
|
87
86
|
return (jsx("div", { "data-testid": 'EvmNetworkControl', className: classNames('evm-network-control__container evm-network-control__container--error', className), children: jsx(UnsupportedNetwork, { showMsg: showNetworkName }) }));
|
|
@@ -99,9 +98,9 @@ const EvmNetworkControl = ({ evmNetworks, className = '', activeClassName = '',
|
|
|
99
98
|
'evm-network-control__arrow-icon--active': isOpen,
|
|
100
99
|
}), children: jsx(SvgStroke, {}) })] }));
|
|
101
100
|
}
|
|
102
|
-
return (
|
|
101
|
+
return (jsxs("div", { "data-testid": 'EvmNetworkControl', onClick: () => network && setIsOpen(!isOpen), className: classNames('evm-network-control__container', {
|
|
103
102
|
[activeClassName]: isOpen,
|
|
104
|
-
}, className), children: currentEvmNetwork.
|
|
103
|
+
}, className), children: [currentEvmNetwork.iconUrls.length > 0 && (jsx(Icon, { size: 'small', children: jsx("img", { src: currentEvmNetwork.iconUrls[0], alt: `${currentEvmNetwork.name} icon` }) })), showNetworkName && (jsx(Typography, { className: 'evm-network-control__network-name', as: 'span', variant: 'body_small', children: currentEvmNetwork.vanityName || currentEvmNetwork.name }))] }));
|
|
105
104
|
}
|
|
106
105
|
return (jsxs("button", { "data-testid": 'EvmNetworkControl', type: 'button', onClick: (e) => {
|
|
107
106
|
e.stopPropagation();
|
|
@@ -110,7 +109,7 @@ const EvmNetworkControl = ({ evmNetworks, className = '', activeClassName = '',
|
|
|
110
109
|
[activeClassName]: isOpen,
|
|
111
110
|
'evm-network-control__container': Boolean(walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.supportsNetworkSwitching()),
|
|
112
111
|
'evm-network-control__container--error': !(currentEvmNetwork === null || currentEvmNetwork === void 0 ? void 0 : currentEvmNetwork.name),
|
|
113
|
-
}), children: [(currentEvmNetwork === null || currentEvmNetwork === void 0 ? void 0 : currentEvmNetwork.name) ? (jsxs(Fragment, { children: [
|
|
112
|
+
}), children: [(currentEvmNetwork === null || currentEvmNetwork === void 0 ? void 0 : currentEvmNetwork.name) ? (jsxs(Fragment, { children: [((_a = currentEvmNetwork === null || currentEvmNetwork === void 0 ? void 0 : currentEvmNetwork.iconUrls) === null || _a === void 0 ? void 0 : _a[0]) && (jsx(Icon, { size: 'small', children: jsx("img", { src: currentEvmNetwork.iconUrls[0], alt: `${currentEvmNetwork.name} icon` }) })), showNetworkName && (jsx(Typography, { className: 'evm-network-control__network-name', as: 'span', variant: 'body_small', children: currentEvmNetwork.vanityName || currentEvmNetwork.name }))] })) : (jsx(UnsupportedNetwork, { showMsg: showNetworkName })), evmNetworks && evmNetworks.length > 1 && (jsx(Icon, { color: 'text-primary', size: 'small', className: classNames('evm-network-control__arrow-icon', {
|
|
114
113
|
'evm-network-control__arrow-icon--active': isOpen,
|
|
115
114
|
}), children: jsx(SvgStroke, {}) }))] }));
|
|
116
115
|
};
|
|
@@ -62,8 +62,8 @@ require('../../../context/WalletGroupContext/WalletGroupContext.cjs');
|
|
|
62
62
|
require('../../../context/MfaSettingsContext/MfaSettingsContext.cjs');
|
|
63
63
|
require('../../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs');
|
|
64
64
|
require('react-focus-lock');
|
|
65
|
-
var useWalletDownloadLinks = require('../../../widgets/DynamicWidget/hooks/useWalletDownloadLinks/useWalletDownloadLinks.cjs');
|
|
66
65
|
var Icon = require('../../Icon/Icon.cjs');
|
|
66
|
+
var useWalletDownloadLinks = require('../../../widgets/DynamicWidget/hooks/useWalletDownloadLinks/useWalletDownloadLinks.cjs');
|
|
67
67
|
require('../../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
|
|
68
68
|
require('../../IconButton/IconButton.cjs');
|
|
69
69
|
require('../../MenuList/Dropdown/Dropdown.cjs');
|
|
@@ -58,8 +58,8 @@ import '../../../context/WalletGroupContext/WalletGroupContext.js';
|
|
|
58
58
|
import '../../../context/MfaSettingsContext/MfaSettingsContext.js';
|
|
59
59
|
import '../../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js';
|
|
60
60
|
import 'react-focus-lock';
|
|
61
|
-
import { useWalletDownloadLinks } from '../../../widgets/DynamicWidget/hooks/useWalletDownloadLinks/useWalletDownloadLinks.js';
|
|
62
61
|
import { Icon } from '../../Icon/Icon.js';
|
|
62
|
+
import { useWalletDownloadLinks } from '../../../widgets/DynamicWidget/hooks/useWalletDownloadLinks/useWalletDownloadLinks.js';
|
|
63
63
|
import '../../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
|
|
64
64
|
import '../../IconButton/IconButton.js';
|
|
65
65
|
import '../../MenuList/Dropdown/Dropdown.js';
|
|
@@ -41,7 +41,7 @@ require('../../locale/locale.cjs');
|
|
|
41
41
|
var isAllowedToLinkWallet = require('../../utils/functions/isAllowedToLinkWallet/isAllowedToLinkWallet.cjs');
|
|
42
42
|
require('../../context/AccessDeniedContext/AccessDeniedContext.cjs');
|
|
43
43
|
require('../../context/AccountExistsContext/AccountExistsContext.cjs');
|
|
44
|
-
require('../../context/UserWalletsContext/UserWalletsContext.cjs');
|
|
44
|
+
var UserWalletsContext = require('../../context/UserWalletsContext/UserWalletsContext.cjs');
|
|
45
45
|
require('../../context/VerificationContext/VerificationContext.cjs');
|
|
46
46
|
require('react-dom');
|
|
47
47
|
require('../../context/WalletContext/WalletContext.cjs');
|
|
@@ -68,8 +68,8 @@ require('../../context/MfaSettingsContext/MfaSettingsContext.cjs');
|
|
|
68
68
|
require('../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs');
|
|
69
69
|
require('react-focus-lock');
|
|
70
70
|
require('../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
|
|
71
|
-
require('
|
|
72
|
-
require('
|
|
71
|
+
var getWalletVerifiedCredential = require('../../utils/functions/getWalletVerifiedCredential/getWalletVerifiedCredential.cjs');
|
|
72
|
+
var Wallet = require('../../widgets/DynamicWidget/components/Wallet/Wallet.cjs');
|
|
73
73
|
var ErrorContainer = require('../ErrorContainer/ErrorContainer.cjs');
|
|
74
74
|
var UserProfileField = require('./parts/UserProfileField/UserProfileField.cjs');
|
|
75
75
|
var UserProfileSection = require('./parts/UserProfileSection/UserProfileSection.cjs');
|
|
@@ -77,6 +77,7 @@ var UserProfileSocialAccount = require('./parts/UserProfileSocialAccount/UserPro
|
|
|
77
77
|
require('formik');
|
|
78
78
|
var TypographyButton = require('../TypographyButton/TypographyButton.cjs');
|
|
79
79
|
require('../../views/TransactionConfirmationView/helpers/transactionErrorMessage.cjs');
|
|
80
|
+
require('../IconButton/IconButton.cjs');
|
|
80
81
|
require('../Input/Input.cjs');
|
|
81
82
|
require('../PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.cjs');
|
|
82
83
|
require('../../context/PasskeyContext/PasskeyContext.cjs');
|
|
@@ -84,6 +85,7 @@ require('../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/
|
|
|
84
85
|
var useDynamicModals = require('../../utils/hooks/useDynamicModals/useDynamicModals.cjs');
|
|
85
86
|
require('../InlineWidget/InlineWidget.cjs');
|
|
86
87
|
require('../IsBrowser/IsBrowser.cjs');
|
|
88
|
+
require('../MenuList/Dropdown/Dropdown.cjs');
|
|
87
89
|
require('../Popper/Popper/Popper.cjs');
|
|
88
90
|
require('../Popper/PopperContext/PopperContext.cjs');
|
|
89
91
|
require('qrcode');
|
|
@@ -93,9 +95,11 @@ require('@hcaptcha/react-hcaptcha');
|
|
|
93
95
|
require('../../context/IpConfigurationContext/IpConfigurationContext.cjs');
|
|
94
96
|
|
|
95
97
|
const UserProfile = ({ rootClassName }) => {
|
|
96
|
-
|
|
98
|
+
var _a;
|
|
99
|
+
const { projectSettings, user, setSelectedWalletConnectorKey, multiWallet, primaryWallet, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
97
100
|
const { error } = ErrorContext.useErrorContext();
|
|
98
101
|
const { setShowLinkNewWalletModal } = useDynamicModals.useDynamicModals();
|
|
102
|
+
const { userWallets } = UserWalletsContext.useInternalUserWallets();
|
|
99
103
|
const { t } = reactI18next.useTranslation();
|
|
100
104
|
const { fieldsConfig } = useFields.useFields();
|
|
101
105
|
const containerRef = React.useRef(null);
|
|
@@ -120,7 +124,10 @@ const UserProfile = ({ rootClassName }) => {
|
|
|
120
124
|
const mapFieldKeyToValue = (fieldKey) => user === null || user === void 0 ? void 0 : user[fieldKey];
|
|
121
125
|
if (!user)
|
|
122
126
|
return null;
|
|
123
|
-
|
|
127
|
+
// if it's multiwallet, the wallet should appear in the wallets tab
|
|
128
|
+
// if there's a primary wallet, it will be displayed in the header
|
|
129
|
+
const wallet = !multiWallet && !primaryWallet && userWallets[0];
|
|
130
|
+
return (jsxRuntime.jsxs("div", { "data-testid": 'userProfile', className: classNames.classNames('user-profile', rootClassName), ref: containerRef, children: [error && jsxRuntime.jsx(ErrorContainer.ErrorContainer, { children: error }), wallet && (jsxRuntime.jsx(UserProfileSection.UserProfileSection, { title: t('dyn_user_profile.my_wallet.title'), children: jsxRuntime.jsx(Wallet.Wallet, { ens: (_a = getWalletVerifiedCredential.getWalletVerifiedCredential(wallet.address, user === null || user === void 0 ? void 0 : user.verifiedCredentials, wallet.chain)) === null || _a === void 0 ? void 0 : _a.nameService, wallet: wallet }, wallet.id) })), (allUserFields === null || allUserFields === void 0 ? void 0 : allUserFields.length) > 0 && (jsxRuntime.jsx(UserProfileSection.UserProfileSection, { title: t('dyn_user_profile.my_information.title'), children: jsxRuntime.jsx("div", { className: 'user-profile__fields', children: allUserFields.map(({ name, validationType, type }) => {
|
|
124
131
|
var _a, _b;
|
|
125
132
|
if (type === sdkApiCore.KycFieldType.Custom) {
|
|
126
133
|
const value = (_b = (_a = user.metadata) === null || _a === void 0 ? void 0 : _a[name]) !== null && _b !== void 0 ? _b : '';
|
|
@@ -37,7 +37,7 @@ import '../../locale/locale.js';
|
|
|
37
37
|
import { isAllowedToLinkWallet } from '../../utils/functions/isAllowedToLinkWallet/isAllowedToLinkWallet.js';
|
|
38
38
|
import '../../context/AccessDeniedContext/AccessDeniedContext.js';
|
|
39
39
|
import '../../context/AccountExistsContext/AccountExistsContext.js';
|
|
40
|
-
import '../../context/UserWalletsContext/UserWalletsContext.js';
|
|
40
|
+
import { useInternalUserWallets } from '../../context/UserWalletsContext/UserWalletsContext.js';
|
|
41
41
|
import '../../context/VerificationContext/VerificationContext.js';
|
|
42
42
|
import 'react-dom';
|
|
43
43
|
import '../../context/WalletContext/WalletContext.js';
|
|
@@ -64,8 +64,8 @@ import '../../context/MfaSettingsContext/MfaSettingsContext.js';
|
|
|
64
64
|
import '../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js';
|
|
65
65
|
import 'react-focus-lock';
|
|
66
66
|
import '../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
|
|
67
|
-
import '
|
|
68
|
-
import '
|
|
67
|
+
import { getWalletVerifiedCredential } from '../../utils/functions/getWalletVerifiedCredential/getWalletVerifiedCredential.js';
|
|
68
|
+
import { Wallet } from '../../widgets/DynamicWidget/components/Wallet/Wallet.js';
|
|
69
69
|
import { ErrorContainer } from '../ErrorContainer/ErrorContainer.js';
|
|
70
70
|
import { UserProfileField } from './parts/UserProfileField/UserProfileField.js';
|
|
71
71
|
import { UserProfileSection } from './parts/UserProfileSection/UserProfileSection.js';
|
|
@@ -73,6 +73,7 @@ import { UserProfileSocialAccount } from './parts/UserProfileSocialAccount/UserP
|
|
|
73
73
|
import 'formik';
|
|
74
74
|
import { TypographyButton } from '../TypographyButton/TypographyButton.js';
|
|
75
75
|
import '../../views/TransactionConfirmationView/helpers/transactionErrorMessage.js';
|
|
76
|
+
import '../IconButton/IconButton.js';
|
|
76
77
|
import '../Input/Input.js';
|
|
77
78
|
import '../PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.js';
|
|
78
79
|
import '../../context/PasskeyContext/PasskeyContext.js';
|
|
@@ -80,6 +81,7 @@ import '../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/P
|
|
|
80
81
|
import { useDynamicModals } from '../../utils/hooks/useDynamicModals/useDynamicModals.js';
|
|
81
82
|
import '../InlineWidget/InlineWidget.js';
|
|
82
83
|
import '../IsBrowser/IsBrowser.js';
|
|
84
|
+
import '../MenuList/Dropdown/Dropdown.js';
|
|
83
85
|
import '../Popper/Popper/Popper.js';
|
|
84
86
|
import '../Popper/PopperContext/PopperContext.js';
|
|
85
87
|
import 'qrcode';
|
|
@@ -89,9 +91,11 @@ import '@hcaptcha/react-hcaptcha';
|
|
|
89
91
|
import '../../context/IpConfigurationContext/IpConfigurationContext.js';
|
|
90
92
|
|
|
91
93
|
const UserProfile = ({ rootClassName }) => {
|
|
92
|
-
|
|
94
|
+
var _a;
|
|
95
|
+
const { projectSettings, user, setSelectedWalletConnectorKey, multiWallet, primaryWallet, } = useInternalDynamicContext();
|
|
93
96
|
const { error } = useErrorContext();
|
|
94
97
|
const { setShowLinkNewWalletModal } = useDynamicModals();
|
|
98
|
+
const { userWallets } = useInternalUserWallets();
|
|
95
99
|
const { t } = useTranslation();
|
|
96
100
|
const { fieldsConfig } = useFields();
|
|
97
101
|
const containerRef = useRef(null);
|
|
@@ -116,7 +120,10 @@ const UserProfile = ({ rootClassName }) => {
|
|
|
116
120
|
const mapFieldKeyToValue = (fieldKey) => user === null || user === void 0 ? void 0 : user[fieldKey];
|
|
117
121
|
if (!user)
|
|
118
122
|
return null;
|
|
119
|
-
|
|
123
|
+
// if it's multiwallet, the wallet should appear in the wallets tab
|
|
124
|
+
// if there's a primary wallet, it will be displayed in the header
|
|
125
|
+
const wallet = !multiWallet && !primaryWallet && userWallets[0];
|
|
126
|
+
return (jsxs("div", { "data-testid": 'userProfile', className: classNames('user-profile', rootClassName), ref: containerRef, children: [error && jsx(ErrorContainer, { children: error }), wallet && (jsx(UserProfileSection, { title: t('dyn_user_profile.my_wallet.title'), children: jsx(Wallet, { ens: (_a = getWalletVerifiedCredential(wallet.address, user === null || user === void 0 ? void 0 : user.verifiedCredentials, wallet.chain)) === null || _a === void 0 ? void 0 : _a.nameService, wallet: wallet }, wallet.id) })), (allUserFields === null || allUserFields === void 0 ? void 0 : allUserFields.length) > 0 && (jsx(UserProfileSection, { title: t('dyn_user_profile.my_information.title'), children: jsx("div", { className: 'user-profile__fields', children: allUserFields.map(({ name, validationType, type }) => {
|
|
120
127
|
var _a, _b;
|
|
121
128
|
if (type === KycFieldType.Custom) {
|
|
122
129
|
const value = (_b = (_a = user.metadata) === null || _a === void 0 ? void 0 : _a[name]) !== null && _b !== void 0 ? _b : '';
|
package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.cjs
CHANGED
|
@@ -64,8 +64,8 @@ require('../../../../context/MfaSettingsContext/MfaSettingsContext.cjs');
|
|
|
64
64
|
require('../../../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs');
|
|
65
65
|
require('react-focus-lock');
|
|
66
66
|
require('../../../../context/ThemeContext/ThemeContext.cjs');
|
|
67
|
-
require('../../../../context/LoadingContext/LoadingContext.cjs');
|
|
68
67
|
var Icon = require('../../../Icon/Icon.cjs');
|
|
68
|
+
require('../../../../context/LoadingContext/LoadingContext.cjs');
|
|
69
69
|
require('../../../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
|
|
70
70
|
require('../../../IconButton/IconButton.cjs');
|
|
71
71
|
require('../../../MenuList/Dropdown/Dropdown.cjs');
|
package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.js
CHANGED
|
@@ -60,8 +60,8 @@ import '../../../../context/MfaSettingsContext/MfaSettingsContext.js';
|
|
|
60
60
|
import '../../../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js';
|
|
61
61
|
import 'react-focus-lock';
|
|
62
62
|
import '../../../../context/ThemeContext/ThemeContext.js';
|
|
63
|
-
import '../../../../context/LoadingContext/LoadingContext.js';
|
|
64
63
|
import { Icon } from '../../../Icon/Icon.js';
|
|
64
|
+
import '../../../../context/LoadingContext/LoadingContext.js';
|
|
65
65
|
import '../../../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
|
|
66
66
|
import '../../../IconButton/IconButton.js';
|
|
67
67
|
import '../../../MenuList/Dropdown/Dropdown.js';
|
|
@@ -160,6 +160,7 @@ export interface IDynamicContext {
|
|
|
160
160
|
setLogInWithEmail: Dispatch<SetStateAction<boolean>>;
|
|
161
161
|
setMultiWalletWidgetState: MultiWalletWidgetStateSetter;
|
|
162
162
|
setPasskeySuccessPopup: (key: PasskeySuccessEnum) => void;
|
|
163
|
+
/** @deprecated Use useSwitchWallet instead */
|
|
163
164
|
setPrimaryWallet: (walletId: string) => Promise<void>;
|
|
164
165
|
setPrimaryWalletId: (walletId: string) => void;
|
|
165
166
|
setQrcodeUri: Dispatch<SetStateAction<string>>;
|
|
@@ -1886,6 +1886,9 @@ const translation = {
|
|
|
1886
1886
|
my_information: {
|
|
1887
1887
|
title: 'My information',
|
|
1888
1888
|
},
|
|
1889
|
+
my_wallet: {
|
|
1890
|
+
title: 'My wallet',
|
|
1891
|
+
},
|
|
1889
1892
|
social_accounts: {
|
|
1890
1893
|
title: 'Social accounts',
|
|
1891
1894
|
},
|
|
@@ -1903,6 +1906,9 @@ const translation = {
|
|
|
1903
1906
|
my_information: {
|
|
1904
1907
|
title: 'My information',
|
|
1905
1908
|
},
|
|
1909
|
+
my_wallet: {
|
|
1910
|
+
title: 'My wallet',
|
|
1911
|
+
},
|
|
1906
1912
|
social_accounts: {
|
|
1907
1913
|
title: 'Social accounts',
|
|
1908
1914
|
},
|
|
@@ -1882,6 +1882,9 @@ export declare const translation: {
|
|
|
1882
1882
|
my_information: {
|
|
1883
1883
|
title: 'My information',
|
|
1884
1884
|
},
|
|
1885
|
+
my_wallet: {
|
|
1886
|
+
title: 'My wallet',
|
|
1887
|
+
},
|
|
1885
1888
|
social_accounts: {
|
|
1886
1889
|
title: 'Social accounts',
|
|
1887
1890
|
},
|
|
@@ -1899,6 +1902,9 @@ export declare const translation: {
|
|
|
1899
1902
|
my_information: {
|
|
1900
1903
|
title: string;
|
|
1901
1904
|
};
|
|
1905
|
+
my_wallet: {
|
|
1906
|
+
title: string;
|
|
1907
|
+
};
|
|
1902
1908
|
social_accounts: {
|
|
1903
1909
|
title: string;
|
|
1904
1910
|
};
|
|
@@ -1882,6 +1882,9 @@ const translation = {
|
|
|
1882
1882
|
my_information: {
|
|
1883
1883
|
title: 'My information',
|
|
1884
1884
|
},
|
|
1885
|
+
my_wallet: {
|
|
1886
|
+
title: 'My wallet',
|
|
1887
|
+
},
|
|
1885
1888
|
social_accounts: {
|
|
1886
1889
|
title: 'Social accounts',
|
|
1887
1890
|
},
|
|
@@ -1899,6 +1902,9 @@ const translation = {
|
|
|
1899
1902
|
my_information: {
|
|
1900
1903
|
title: 'My information',
|
|
1901
1904
|
},
|
|
1905
|
+
my_wallet: {
|
|
1906
|
+
title: 'My wallet',
|
|
1907
|
+
},
|
|
1902
1908
|
social_accounts: {
|
|
1903
1909
|
title: 'Social accounts',
|
|
1904
1910
|
},
|