@dynamic-labs/sdk-react-core 0.17.0-RC.24 → 0.17.0-RC.26
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 +26 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +7 -7
- package/src/lib/components/{WalletOrSocialMagicIcon/WalletOrSocialMagicIcon.cjs → AuthProviderIcon/AuthProviderIcon.cjs} +22 -18
- package/src/lib/components/{WalletOrSocialMagicIcon/WalletOrSocialMagicIcon.d.ts → AuthProviderIcon/AuthProviderIcon.d.ts} +1 -1
- package/src/lib/components/{WalletOrSocialMagicIcon/WalletOrSocialMagicIcon.js → AuthProviderIcon/AuthProviderIcon.js} +23 -19
- package/src/lib/components/AuthProviderIcon/index.d.ts +1 -0
- package/src/lib/components/FormFieldLabel/FormFieldLabel.cjs +10 -0
- package/src/lib/components/FormFieldLabel/FormFieldLabel.d.ts +8 -0
- package/src/lib/components/FormFieldLabel/FormFieldLabel.js +6 -0
- package/src/lib/components/FormFieldLabel/index.d.ts +1 -0
- package/src/lib/components/Input/Input.cjs +8 -8
- package/src/lib/components/Input/Input.js +9 -9
- package/src/lib/components/OTPVerificationView/OTPVerificationView.cjs +2 -1
- package/src/lib/components/OTPVerificationView/OTPVerificationView.js +2 -1
- package/src/lib/components/SendBalanceForm/SendBalanceForm.cjs +1 -1
- package/src/lib/components/SendBalanceForm/SendBalanceForm.js +1 -1
- package/src/lib/components/SendBalancePageLayout/SendBalancePageLayout.cjs +2 -1
- package/src/lib/components/SendBalancePageLayout/SendBalancePageLayout.js +2 -1
- package/src/lib/components/UserProfile/parts/UserProfileField/UserProfileField.cjs +1 -1
- package/src/lib/components/UserProfile/parts/UserProfileField/UserProfileField.js +1 -1
- package/src/lib/components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.cjs +2 -2
- package/src/lib/components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.d.ts +2 -0
- package/src/lib/components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.js +2 -2
- package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.cjs +18 -9
- package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.js +18 -9
- package/src/lib/components/index.d.ts +1 -0
- package/src/lib/context/SocialRedirectContext/SocialRedirectContext.cjs +7 -0
- package/src/lib/context/SocialRedirectContext/SocialRedirectContext.js +7 -0
- package/src/lib/shared/assets/add.cjs +8 -9
- package/src/lib/shared/assets/add.js +8 -9
- package/src/lib/shared/utils/functions/shortenEmail/shortenEmail.cjs +27 -0
- package/src/lib/shared/utils/functions/shortenEmail/shortenEmail.d.ts +6 -0
- package/src/lib/shared/utils/functions/shortenEmail/shortenEmail.js +23 -0
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/functions/hasWalletGroupFlag/hasWalletGroupFlag.d.ts +1 -0
- package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.cjs +2 -1
- package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.js +2 -1
- package/src/lib/views/CollectUserDataView/CollectUserDataView.cjs +2 -2
- package/src/lib/views/CollectUserDataView/CollectUserDataView.js +2 -2
- package/src/lib/views/EmailVerification/EmailVerification.cjs +2 -1
- package/src/lib/views/EmailVerification/EmailVerification.js +2 -1
- package/src/lib/views/LoginWithEmailView/LoginWithEmailView.cjs +10 -5
- package/src/lib/views/LoginWithEmailView/LoginWithEmailView.js +10 -5
- package/src/lib/views/LoginWithEmailView/components/LoginWithEmailForm/LoginWithEmailForm.cjs +1 -4
- package/src/lib/views/LoginWithEmailView/components/LoginWithEmailForm/LoginWithEmailForm.js +2 -5
- package/src/lib/views/LoginWithEmailView/components/SocialSignIn/SocialSignIn.cjs +1 -1
- package/src/lib/views/LoginWithEmailView/components/SocialSignIn/SocialSignIn.js +1 -1
- package/src/lib/views/NetworkNotSupported/NetworkNotSupported.cjs +2 -2
- package/src/lib/views/NetworkNotSupported/NetworkNotSupported.js +2 -2
- package/src/lib/views/NoAccess/NoAccess.cjs +2 -2
- package/src/lib/views/NoAccess/NoAccess.js +2 -2
- package/src/lib/widgets/DynamicWidget/components/AccountControl/AccountControl.cjs +4 -3
- package/src/lib/widgets/DynamicWidget/components/AccountControl/AccountControl.js +4 -3
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.js +2 -2
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetWalletHeader/DynamicWidgetWalletHeader.cjs +3 -3
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetWalletHeader/DynamicWidgetWalletHeader.js +4 -4
- package/src/lib/widgets/DynamicWidget/components/EmailOTPConnectorPendingSignModalContent/EmailOTPConnectorPendingSignModalContent.cjs +12 -1
- package/src/lib/widgets/DynamicWidget/components/EmailOTPConnectorPendingSignModalContent/EmailOTPConnectorPendingSignModalContent.js +12 -1
- package/src/lib/widgets/DynamicWidget/components/Wallet/Wallet.cjs +8 -3
- package/src/lib/widgets/DynamicWidget/components/Wallet/Wallet.js +9 -4
- package/src/lib/widgets/DynamicWidget/prompts/PendingConnectionModal/PendingConnectionModal.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/prompts/PendingConnectionModal/PendingConnectionModal.js +2 -2
- package/src/lib/components/WalletOrSocialMagicIcon/index.d.ts +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,30 @@
|
|
|
1
1
|
|
|
2
|
+
## [0.17.0-RC.26](https://github.com/dynamic-labs/DynamicAuth/compare/v0.17.0-RC.25...v0.17.0-RC.26) (2023-06-05)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* disable button on social unlink ([#2234](https://github.com/dynamic-labs/DynamicAuth/issues/2234)) ([7f148de](https://github.com/dynamic-labs/DynamicAuth/commit/7f148de76b0fca632e1b4d6ff71c18eb0207c02b))
|
|
8
|
+
* update magic + email icon in auth flow views ([#2224](https://github.com/dynamic-labs/DynamicAuth/issues/2224)) ([93f1ed6](https://github.com/dynamic-labs/DynamicAuth/commit/93f1ed644428701c2747565033d0ad113fa8eeb2))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **wallets:** keep magic social wallet connector on mobile ([#2242](https://github.com/dynamic-labs/DynamicAuth/issues/2242)) ([35c092d](https://github.com/dynamic-labs/DynamicAuth/commit/35c092da3b8a76c74ae25558489d663ce963d72f))
|
|
14
|
+
* wrong logger instance in UserProfileSocialAccount ([#2248](https://github.com/dynamic-labs/DynamicAuth/issues/2248)) ([814108d](https://github.com/dynamic-labs/DynamicAuth/commit/814108d416d9d730bed8976956bc7974c7fde2a8))
|
|
15
|
+
|
|
16
|
+
## [0.17.0-RC.25](https://github.com/dynamic-labs/DynamicAuth/compare/v0.17.0-RC.24...v0.17.0-RC.25) (2023-06-05)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Bug Fixes
|
|
20
|
+
|
|
21
|
+
* **EmailOTPMagicWalletConnector:** allow user to reconnect with email wallet ([#2230](https://github.com/dynamic-labs/DynamicAuth/issues/2230)) ([6059886](https://github.com/dynamic-labs/DynamicAuth/commit/605988650a783ae824bb8c45edc5533fecf8726a))
|
|
22
|
+
* only set wagmi connector if connected chain is evm ([#2237](https://github.com/dynamic-labs/DynamicAuth/issues/2237)) ([a7be7d3](https://github.com/dynamic-labs/DynamicAuth/commit/a7be7d302d1e74088b0aa2b6848c879079e6f963))
|
|
23
|
+
* Revert "fix(ViewContext): only set view when on wallet list" ([#2235](https://github.com/dynamic-labs/DynamicAuth/issues/2235)) ([e790315](https://github.com/dynamic-labs/DynamicAuth/commit/e79031577f640161cc5f0b9b2e695e22d9a98901)), closes [#2226](https://github.com/dynamic-labs/DynamicAuth/issues/2226)
|
|
24
|
+
* set view to social-redirect-view while waiting to process magic redirect ([#2229](https://github.com/dynamic-labs/DynamicAuth/issues/2229)) ([f50a29c](https://github.com/dynamic-labs/DynamicAuth/commit/f50a29c0b9623c703f1577c7a41fcc5aee58abb8))
|
|
25
|
+
* user profile does not extend on mobile ([#2236](https://github.com/dynamic-labs/DynamicAuth/issues/2236)) ([5bb7912](https://github.com/dynamic-labs/DynamicAuth/commit/5bb7912a865338fdf6eca1a19ff4b74a3fb18eeb))
|
|
26
|
+
* **ViewContext:** only set view when on wallet list ([#2226](https://github.com/dynamic-labs/DynamicAuth/issues/2226)) ([85e8fc1](https://github.com/dynamic-labs/DynamicAuth/commit/85e8fc140069cabff41f4067ac93ea0c5cfaa161))
|
|
27
|
+
|
|
2
28
|
## [0.17.0-RC.24](https://github.com/dynamic-labs/DynamicAuth/compare/v0.17.0-RC.23...v0.17.0-RC.24) (2023-06-02)
|
|
3
29
|
|
|
4
30
|
## [0.17.0-RC.23](https://github.com/dynamic-labs/DynamicAuth/compare/v0.17.0-RC.22...v0.17.0-RC.23) (2023-06-02)
|
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": "0.17.0-RC.
|
|
3
|
+
"version": "0.17.0-RC.26",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/dynamic-labs/DynamicAuth.git",
|
|
@@ -17,12 +17,12 @@
|
|
|
17
17
|
"formik": "2.2.9",
|
|
18
18
|
"qrcode": "1.5.1",
|
|
19
19
|
"ethers": "5.7.2",
|
|
20
|
-
"@dynamic-labs/logger": "0.17.0-RC.
|
|
21
|
-
"@dynamic-labs/multi-wallet": "0.17.0-RC.
|
|
22
|
-
"@dynamic-labs/rpc-providers": "0.17.0-RC.
|
|
23
|
-
"@dynamic-labs/types": "0.17.0-RC.
|
|
24
|
-
"@dynamic-labs/utils": "0.17.0-RC.
|
|
25
|
-
"@dynamic-labs/wallet-connector-core": "0.17.0-RC.
|
|
20
|
+
"@dynamic-labs/logger": "0.17.0-RC.26",
|
|
21
|
+
"@dynamic-labs/multi-wallet": "0.17.0-RC.26",
|
|
22
|
+
"@dynamic-labs/rpc-providers": "0.17.0-RC.26",
|
|
23
|
+
"@dynamic-labs/types": "0.17.0-RC.26",
|
|
24
|
+
"@dynamic-labs/utils": "0.17.0-RC.26",
|
|
25
|
+
"@dynamic-labs/wallet-connector-core": "0.17.0-RC.26"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"semver": "7.3.8"
|
|
@@ -5,12 +5,12 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
var walletBook = require('@dynamic-labs/wallet-book');
|
|
7
7
|
var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
|
|
8
|
+
var iconic = require('@dynamic-labs/iconic');
|
|
8
9
|
require('../../utils/constants/colors.cjs');
|
|
9
10
|
require('@dynamic-labs/multi-wallet');
|
|
10
11
|
require('@dynamic-labs/utils');
|
|
11
12
|
require('@dynamic-labs/sdk-api');
|
|
12
13
|
require('../../shared/logger.cjs');
|
|
13
|
-
require('@dynamic-labs/iconic');
|
|
14
14
|
require('../../context/ViewContext/ViewContext.cjs');
|
|
15
15
|
require('react');
|
|
16
16
|
require('ethers');
|
|
@@ -22,7 +22,19 @@ var useInternalDynamicContext = require('../../context/DynamicContext/useInterna
|
|
|
22
22
|
var WalletIconWithStatus = require('../../widgets/DynamicWidget/components/WalletIconWithStatus/WalletIconWithStatus.cjs');
|
|
23
23
|
var AccessDeniedContext = require('../../context/AccessDeniedContext/AccessDeniedContext.cjs');
|
|
24
24
|
|
|
25
|
-
const
|
|
25
|
+
const getMagicEmailOrSocialIcon = ({ wallet, jwt, }) => {
|
|
26
|
+
let Icon = null;
|
|
27
|
+
if (walletConnectorCore.isEmailOTPWalletConnector(wallet.connector)) {
|
|
28
|
+
Icon = iconic.SignInWithEmailIcon;
|
|
29
|
+
}
|
|
30
|
+
if (walletConnectorCore.isSocialWalletConnector(wallet.connector)) {
|
|
31
|
+
const socialAccountDataForWallet = getReferencedAccount.getReferencedAccount(jwt, wallet.id);
|
|
32
|
+
const MagicSocialWalletIcon = getSocialIcon.getSocialIcon(socialAccountDataForWallet === null || socialAccountDataForWallet === void 0 ? void 0 : socialAccountDataForWallet.oauthProvider);
|
|
33
|
+
Icon = MagicSocialWalletIcon;
|
|
34
|
+
}
|
|
35
|
+
return Icon;
|
|
36
|
+
};
|
|
37
|
+
const AuthProviderIcon = ({ jwt, iconSize = 64, showStatus, wallet, }) => {
|
|
26
38
|
const { primaryWallet, selectedWalletConnector } = useInternalDynamicContext.useInternalDynamicContext();
|
|
27
39
|
const { deniedOauthProvider, deniedAddress } = AccessDeniedContext.useAccessDeniedContext();
|
|
28
40
|
// when access is denied we don't have jwt set, so we're getting this value out of useAccessDeniedContext
|
|
@@ -41,22 +53,14 @@ const WalletOrSocialMagicIcon = ({ jwt, iconSize = 64, showStatus, wallet, }) =>
|
|
|
41
53
|
return null;
|
|
42
54
|
}
|
|
43
55
|
const walletForIcon = wallet ? wallet : primaryWallet;
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
// to show social icon
|
|
52
|
-
return (jsxRuntime.jsx(MagicSocialWalletIcon, { style: { height: pixelToRem.pixelToRem(iconSize), width: pixelToRem.pixelToRem(iconSize) } }));
|
|
53
|
-
}
|
|
54
|
-
// to show wallet icon with status dot
|
|
55
|
-
if (showStatus) {
|
|
56
|
-
return (jsxRuntime.jsx(WalletIconWithStatus.WalletIconWithStatus, { iconSize: iconSize, walletName: walletForIcon.connector.name, connected: walletForIcon.connected, variant: 'secondary' }));
|
|
56
|
+
const MagicEmailOrSocialIcon = getMagicEmailOrSocialIcon({
|
|
57
|
+
jwt,
|
|
58
|
+
wallet: walletForIcon,
|
|
59
|
+
});
|
|
60
|
+
if (MagicEmailOrSocialIcon) {
|
|
61
|
+
return showStatus ? (jsxRuntime.jsx(IconWithStatus.IconWithStatus, { iconSize: iconSize, Icon: MagicEmailOrSocialIcon, variant: walletForIcon.connected ? 'green' : 'red' })) : (jsxRuntime.jsx(MagicEmailOrSocialIcon, { style: { height: pixelToRem.pixelToRem(iconSize), width: pixelToRem.pixelToRem(iconSize) } }));
|
|
57
62
|
}
|
|
58
|
-
|
|
59
|
-
return (jsxRuntime.jsx(walletBook.WalletIcon, { walletName: walletForIcon.connector.name, style: { height: pixelToRem.pixelToRem(iconSize), width: pixelToRem.pixelToRem(iconSize) } }));
|
|
63
|
+
return showStatus ? (jsxRuntime.jsx(WalletIconWithStatus.WalletIconWithStatus, { iconSize: iconSize, walletName: walletForIcon.connector.name, connected: walletForIcon.connected, variant: 'secondary' })) : (jsxRuntime.jsx(walletBook.WalletIcon, { walletName: walletForIcon.connector.name, style: { height: pixelToRem.pixelToRem(iconSize), width: pixelToRem.pixelToRem(iconSize) } }));
|
|
60
64
|
};
|
|
61
65
|
|
|
62
|
-
exports.
|
|
66
|
+
exports.AuthProviderIcon = AuthProviderIcon;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { WalletIcon } from '@dynamic-labs/wallet-book';
|
|
3
|
-
import { isSocialWalletConnector } from '@dynamic-labs/wallet-connector-core';
|
|
3
|
+
import { isEmailOTPWalletConnector, isSocialWalletConnector } from '@dynamic-labs/wallet-connector-core';
|
|
4
|
+
import { SignInWithEmailIcon } from '@dynamic-labs/iconic';
|
|
4
5
|
import '../../utils/constants/colors.js';
|
|
5
6
|
import '@dynamic-labs/multi-wallet';
|
|
6
7
|
import '@dynamic-labs/utils';
|
|
7
8
|
import '@dynamic-labs/sdk-api';
|
|
8
9
|
import '../../shared/logger.js';
|
|
9
|
-
import '@dynamic-labs/iconic';
|
|
10
10
|
import '../../context/ViewContext/ViewContext.js';
|
|
11
11
|
import 'react';
|
|
12
12
|
import 'ethers';
|
|
@@ -18,7 +18,19 @@ import { useInternalDynamicContext } from '../../context/DynamicContext/useInter
|
|
|
18
18
|
import { WalletIconWithStatus } from '../../widgets/DynamicWidget/components/WalletIconWithStatus/WalletIconWithStatus.js';
|
|
19
19
|
import { useAccessDeniedContext } from '../../context/AccessDeniedContext/AccessDeniedContext.js';
|
|
20
20
|
|
|
21
|
-
const
|
|
21
|
+
const getMagicEmailOrSocialIcon = ({ wallet, jwt, }) => {
|
|
22
|
+
let Icon = null;
|
|
23
|
+
if (isEmailOTPWalletConnector(wallet.connector)) {
|
|
24
|
+
Icon = SignInWithEmailIcon;
|
|
25
|
+
}
|
|
26
|
+
if (isSocialWalletConnector(wallet.connector)) {
|
|
27
|
+
const socialAccountDataForWallet = getReferencedAccount(jwt, wallet.id);
|
|
28
|
+
const MagicSocialWalletIcon = getSocialIcon(socialAccountDataForWallet === null || socialAccountDataForWallet === void 0 ? void 0 : socialAccountDataForWallet.oauthProvider);
|
|
29
|
+
Icon = MagicSocialWalletIcon;
|
|
30
|
+
}
|
|
31
|
+
return Icon;
|
|
32
|
+
};
|
|
33
|
+
const AuthProviderIcon = ({ jwt, iconSize = 64, showStatus, wallet, }) => {
|
|
22
34
|
const { primaryWallet, selectedWalletConnector } = useInternalDynamicContext();
|
|
23
35
|
const { deniedOauthProvider, deniedAddress } = useAccessDeniedContext();
|
|
24
36
|
// when access is denied we don't have jwt set, so we're getting this value out of useAccessDeniedContext
|
|
@@ -37,22 +49,14 @@ const WalletOrSocialMagicIcon = ({ jwt, iconSize = 64, showStatus, wallet, }) =>
|
|
|
37
49
|
return null;
|
|
38
50
|
}
|
|
39
51
|
const walletForIcon = wallet ? wallet : primaryWallet;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
// to show social icon
|
|
48
|
-
return (jsx(MagicSocialWalletIcon, { style: { height: pixelToRem(iconSize), width: pixelToRem(iconSize) } }));
|
|
49
|
-
}
|
|
50
|
-
// to show wallet icon with status dot
|
|
51
|
-
if (showStatus) {
|
|
52
|
-
return (jsx(WalletIconWithStatus, { iconSize: iconSize, walletName: walletForIcon.connector.name, connected: walletForIcon.connected, variant: 'secondary' }));
|
|
52
|
+
const MagicEmailOrSocialIcon = getMagicEmailOrSocialIcon({
|
|
53
|
+
jwt,
|
|
54
|
+
wallet: walletForIcon,
|
|
55
|
+
});
|
|
56
|
+
if (MagicEmailOrSocialIcon) {
|
|
57
|
+
return showStatus ? (jsx(IconWithStatus, { iconSize: iconSize, Icon: MagicEmailOrSocialIcon, variant: walletForIcon.connected ? 'green' : 'red' })) : (jsx(MagicEmailOrSocialIcon, { style: { height: pixelToRem(iconSize), width: pixelToRem(iconSize) } }));
|
|
53
58
|
}
|
|
54
|
-
|
|
55
|
-
return (jsx(WalletIcon, { walletName: walletForIcon.connector.name, style: { height: pixelToRem(iconSize), width: pixelToRem(iconSize) } }));
|
|
59
|
+
return showStatus ? (jsx(WalletIconWithStatus, { iconSize: iconSize, walletName: walletForIcon.connector.name, connected: walletForIcon.connected, variant: 'secondary' })) : (jsx(WalletIcon, { walletName: walletForIcon.connector.name, style: { height: pixelToRem(iconSize), width: pixelToRem(iconSize) } }));
|
|
56
60
|
};
|
|
57
61
|
|
|
58
|
-
export {
|
|
62
|
+
export { AuthProviderIcon };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { AuthProviderIcon } from './AuthProviderIcon';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
var classNames = require('../../utils/functions/classNames/classNames.cjs');
|
|
7
|
+
|
|
8
|
+
const FormFieldLabel = ({ children, htmlFor, className, divider, }) => (jsxRuntime.jsx("label", Object.assign({ className: classNames.classNames('form-field-label', { 'form-field-label__with-divider': divider }, className), htmlFor: htmlFor }, { children: children })));
|
|
9
|
+
|
|
10
|
+
exports.FormFieldLabel = FormFieldLabel;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { classNames } from '../../utils/functions/classNames/classNames.js';
|
|
3
|
+
|
|
4
|
+
const FormFieldLabel = ({ children, htmlFor, className, divider, }) => (jsx("label", Object.assign({ className: classNames('form-field-label', { 'form-field-label__with-divider': divider }, className), htmlFor: htmlFor }, { children: children })));
|
|
5
|
+
|
|
6
|
+
export { FormFieldLabel };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { FormFieldLabel } from './FormFieldLabel';
|
|
@@ -9,15 +9,15 @@ var Typography = require('../Typography/Typography.cjs');
|
|
|
9
9
|
|
|
10
10
|
const Input = (_a) => {
|
|
11
11
|
var { className = '', id, label, type, onChange, onBlur, name, value, optional, error = false, disabled, message, placeholder, variant = 'dense', suffix } = _a, rest = _tslib.__rest(_a, ["className", "id", "label", "type", "onChange", "onBlur", "name", "value", "optional", "error", "disabled", "message", "placeholder", "variant", "suffix"]);
|
|
12
|
-
return (jsxRuntime.jsxs(
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
return (jsxRuntime.jsxs("div", Object.assign({ className: classNames.classNames('input__container', {
|
|
13
|
+
'input__container--dense': variant === 'dense',
|
|
14
|
+
'input__container--regular': variant === 'regular',
|
|
15
|
+
}) }, { children: [jsxRuntime.jsx("input", Object.assign({}, rest, { name: name, value: value, onChange: onChange, onBlur: onBlur, type: type, id: id, placeholder: variant === 'regular' ? placeholder : label, disabled: disabled, className: classNames.classNames('input', className, {
|
|
16
|
+
input__error: error,
|
|
17
|
+
input__has_trailing: optional,
|
|
18
|
+
}) })), jsxRuntime.jsx("label", Object.assign({ htmlFor: id, className: classNames.classNames('input__label') }, { children: label })), suffix && jsxRuntime.jsx("div", Object.assign({ className: classNames.classNames('input__suffix') }, { children: suffix })), optional && jsxRuntime.jsx("span", Object.assign({ className: 'input__trailing' }, { children: "Optional" })), Boolean(message) && (jsxRuntime.jsx(Typography.Typography, Object.assign({ variant: 'body_mini', className: classNames.classNames('input__message', {
|
|
19
19
|
input__message__error: error,
|
|
20
|
-
}) }, { children: message })))] }));
|
|
20
|
+
}) }, { children: message })))] })));
|
|
21
21
|
};
|
|
22
22
|
|
|
23
23
|
exports.Input = Input;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { __rest } from '../../../../_virtual/_tslib.js';
|
|
2
|
-
import { jsxs,
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { classNames } from '../../utils/functions/classNames/classNames.js';
|
|
4
4
|
import { Typography } from '../Typography/Typography.js';
|
|
5
5
|
|
|
6
6
|
const Input = (_a) => {
|
|
7
7
|
var { className = '', id, label, type, onChange, onBlur, name, value, optional, error = false, disabled, message, placeholder, variant = 'dense', suffix } = _a, rest = __rest(_a, ["className", "id", "label", "type", "onChange", "onBlur", "name", "value", "optional", "error", "disabled", "message", "placeholder", "variant", "suffix"]);
|
|
8
|
-
return (jsxs(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
return (jsxs("div", Object.assign({ className: classNames('input__container', {
|
|
9
|
+
'input__container--dense': variant === 'dense',
|
|
10
|
+
'input__container--regular': variant === 'regular',
|
|
11
|
+
}) }, { children: [jsx("input", Object.assign({}, rest, { name: name, value: value, onChange: onChange, onBlur: onBlur, type: type, id: id, placeholder: variant === 'regular' ? placeholder : label, disabled: disabled, className: classNames('input', className, {
|
|
12
|
+
input__error: error,
|
|
13
|
+
input__has_trailing: optional,
|
|
14
|
+
}) })), jsx("label", Object.assign({ htmlFor: id, className: classNames('input__label') }, { children: label })), suffix && jsx("div", Object.assign({ className: classNames('input__suffix') }, { children: suffix })), optional && jsx("span", Object.assign({ className: 'input__trailing' }, { children: "Optional" })), Boolean(message) && (jsx(Typography, Object.assign({ variant: 'body_mini', className: classNames('input__message', {
|
|
15
15
|
input__message__error: error,
|
|
16
|
-
}) }, { children: message })))] }));
|
|
16
|
+
}) }, { children: message })))] })));
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
export { Input };
|
|
@@ -43,6 +43,7 @@ require('../../utils/hooks/useUserUpdateRequest/useUserUpdateRequest.cjs');
|
|
|
43
43
|
var TosAndPp = require('../TosAndPp/TosAndPp.cjs');
|
|
44
44
|
var PinField = require('../PinField/PinField.cjs');
|
|
45
45
|
var ModalHeaderBanner = require('../ModalHeaderBanner/ModalHeaderBanner.cjs');
|
|
46
|
+
var shortenEmail = require('../../shared/utils/functions/shortenEmail/shortenEmail.cjs');
|
|
46
47
|
require('../Popper/Popper/Popper.cjs');
|
|
47
48
|
require('../Popper/PopperContext/PopperContext.cjs');
|
|
48
49
|
require('@dynamic-labs/wallet-book');
|
|
@@ -50,7 +51,7 @@ require('../SendBalanceForm/SendBalanceForm.cjs');
|
|
|
50
51
|
|
|
51
52
|
const OTPVerificationView = ({ onClickBack, onClickEditEmail, isLoading, email, onPinComplete, isValid, error, termsOfServiceUrl, privacyPolicyUrl, onPinChange, displayPoweredByDynamic = false, }) => {
|
|
52
53
|
const backButton = (jsxRuntime.jsx(IconButton.IconButton, Object.assign({ type: 'button', onClick: onClickBack, "data-testid": 'back-button' }, { children: jsxRuntime.jsx(chevronLeft.ReactComponent, {}) })));
|
|
53
|
-
return (jsxRuntime.jsxs("div", Object.assign({ className: 'otp-verification-view' }, { children: [jsxRuntime.jsx(ModalHeaderBanner.ModalHeaderBanner, { type: 'error', message: error === null || error === void 0 ? void 0 : error.message }), jsxRuntime.jsx(ModalHeader.ModalHeader, Object.assign({ alignContent: 'bottom', leading: onClickBack && backButton }, { children: jsxRuntime.jsxs("div", Object.assign({ className: 'otp-verification-view__status-header' }, { children: [isValid && (jsxRuntime.jsx(IconWithStatus.IconWithStatus, { Icon: iconic.SignInWithEmailIcon, iconSize: 50, InnerIcon: check.ReactComponent })), !isValid && (jsxRuntime.jsx(IconWithSpinner.IconWithSpinner, { Icon: iconic.SignInWithEmailIcon, iconSize: 80, isSpinning: isLoading }))] })) })), jsxRuntime.jsx(Typography.Typography, Object.assign({ weight: 'medium', variant: 'title', color: 'primary', className: 'otp-verification-view__title' }, { children: isValid ? 'Verification code confirmed' : 'Confirm verification code' })), jsxRuntime.jsxs("div", Object.assign({ className: 'otp-verification-view__body' }, { children: [isValid && (jsxRuntime.jsx(Typography.Typography, Object.assign({ variant: 'body_normal', weight: 'regular', color: 'secondary' }, { children: "Hang tight while we get things ready for you" }))), !isValid && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Typography.Typography, Object.assign({ variant: 'body_normal', weight: 'regular', color: 'secondary' }, { children: "We\u2019ve sent a verification code to" })), jsxRuntime.jsxs("div", Object.assign({ className: 'otp-verification-view__email-container' }, { children: [jsxRuntime.jsx(Typography.Typography, Object.assign({ variant: 'body_normal', weight: 'bold', color: 'secondary' }, { children: email })), onClickEditEmail && (jsxRuntime.jsx(IconButton.IconButton, Object.assign({ onClick: onClickEditEmail, "data-testid": 'otp-verification-view__edit-button' }, { children: jsxRuntime.jsx(Icon.Icon, Object.assign({ color: 'text-tertiary' }, { children: jsxRuntime.jsx(pencilAltIcon.ReactComponent, {}) })) })))] }))] }))] })), jsxRuntime.jsx(PinField.PinField, { initialValue: Array(6).join('.').split('.'), isLoading: isLoading, handleComplete: onPinComplete, isValidated: isValid, inputMode: 'numeric', pattern: '[0-9]*', hasError: Boolean(error), onChange: onPinChange }), jsxRuntime.jsxs("div", Object.assign({ className: 'otp-verification-view__footer' }, { children: [termsOfServiceUrl && privacyPolicyUrl && (jsxRuntime.jsx(TosAndPp.TosAndPp, { mode: 'logging in', privacyPolicyUrl: privacyPolicyUrl, termsOfServiceUrl: termsOfServiceUrl })), displayPoweredByDynamic && jsxRuntime.jsx(PoweredByDynamic.PoweredByDynamic, {})] }))] })));
|
|
54
|
+
return (jsxRuntime.jsxs("div", Object.assign({ className: 'otp-verification-view' }, { children: [jsxRuntime.jsx(ModalHeaderBanner.ModalHeaderBanner, { type: 'error', message: error === null || error === void 0 ? void 0 : error.message }), jsxRuntime.jsx(ModalHeader.ModalHeader, Object.assign({ alignContent: 'bottom', leading: onClickBack && backButton }, { children: jsxRuntime.jsxs("div", Object.assign({ className: 'otp-verification-view__status-header' }, { children: [isValid && (jsxRuntime.jsx(IconWithStatus.IconWithStatus, { Icon: iconic.SignInWithEmailIcon, iconSize: 50, InnerIcon: check.ReactComponent })), !isValid && (jsxRuntime.jsx(IconWithSpinner.IconWithSpinner, { Icon: iconic.SignInWithEmailIcon, iconSize: 80, isSpinning: isLoading }))] })) })), jsxRuntime.jsx(Typography.Typography, Object.assign({ weight: 'medium', variant: 'title', color: 'primary', className: 'otp-verification-view__title' }, { children: isValid ? 'Verification code confirmed' : 'Confirm verification code' })), jsxRuntime.jsxs("div", Object.assign({ className: 'otp-verification-view__body' }, { children: [isValid && (jsxRuntime.jsx(Typography.Typography, Object.assign({ variant: 'body_normal', weight: 'regular', color: 'secondary' }, { children: "Hang tight while we get things ready for you" }))), !isValid && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Typography.Typography, Object.assign({ variant: 'body_normal', weight: 'regular', color: 'secondary' }, { children: "We\u2019ve sent a verification code to" })), jsxRuntime.jsxs("div", Object.assign({ className: 'otp-verification-view__email-container' }, { children: [jsxRuntime.jsx(Typography.Typography, Object.assign({ variant: 'body_normal', weight: 'bold', color: 'secondary' }, { children: shortenEmail.shortenEmail(email) })), onClickEditEmail && (jsxRuntime.jsx(IconButton.IconButton, Object.assign({ onClick: onClickEditEmail, "data-testid": 'otp-verification-view__edit-button' }, { children: jsxRuntime.jsx(Icon.Icon, Object.assign({ color: 'text-tertiary' }, { children: jsxRuntime.jsx(pencilAltIcon.ReactComponent, {}) })) })))] }))] }))] })), jsxRuntime.jsx(PinField.PinField, { initialValue: Array(6).join('.').split('.'), isLoading: isLoading, handleComplete: onPinComplete, isValidated: isValid, inputMode: 'numeric', pattern: '[0-9]*', hasError: Boolean(error), onChange: onPinChange }), jsxRuntime.jsxs("div", Object.assign({ className: 'otp-verification-view__footer' }, { children: [termsOfServiceUrl && privacyPolicyUrl && (jsxRuntime.jsx(TosAndPp.TosAndPp, { mode: 'logging in', privacyPolicyUrl: privacyPolicyUrl, termsOfServiceUrl: termsOfServiceUrl })), displayPoweredByDynamic && jsxRuntime.jsx(PoweredByDynamic.PoweredByDynamic, {})] }))] })));
|
|
54
55
|
};
|
|
55
56
|
|
|
56
57
|
exports.OTPVerificationView = OTPVerificationView;
|
|
@@ -39,6 +39,7 @@ import '../../utils/hooks/useUserUpdateRequest/useUserUpdateRequest.js';
|
|
|
39
39
|
import { TosAndPp } from '../TosAndPp/TosAndPp.js';
|
|
40
40
|
import { PinField } from '../PinField/PinField.js';
|
|
41
41
|
import { ModalHeaderBanner } from '../ModalHeaderBanner/ModalHeaderBanner.js';
|
|
42
|
+
import { shortenEmail } from '../../shared/utils/functions/shortenEmail/shortenEmail.js';
|
|
42
43
|
import '../Popper/Popper/Popper.js';
|
|
43
44
|
import '../Popper/PopperContext/PopperContext.js';
|
|
44
45
|
import '@dynamic-labs/wallet-book';
|
|
@@ -46,7 +47,7 @@ import '../SendBalanceForm/SendBalanceForm.js';
|
|
|
46
47
|
|
|
47
48
|
const OTPVerificationView = ({ onClickBack, onClickEditEmail, isLoading, email, onPinComplete, isValid, error, termsOfServiceUrl, privacyPolicyUrl, onPinChange, displayPoweredByDynamic = false, }) => {
|
|
48
49
|
const backButton = (jsx(IconButton, Object.assign({ type: 'button', onClick: onClickBack, "data-testid": 'back-button' }, { children: jsx(SvgChevronLeft, {}) })));
|
|
49
|
-
return (jsxs("div", Object.assign({ className: 'otp-verification-view' }, { children: [jsx(ModalHeaderBanner, { type: 'error', message: error === null || error === void 0 ? void 0 : error.message }), jsx(ModalHeader, Object.assign({ alignContent: 'bottom', leading: onClickBack && backButton }, { children: jsxs("div", Object.assign({ className: 'otp-verification-view__status-header' }, { children: [isValid && (jsx(IconWithStatus, { Icon: SignInWithEmailIcon, iconSize: 50, InnerIcon: SvgCheck })), !isValid && (jsx(IconWithSpinner, { Icon: SignInWithEmailIcon, iconSize: 80, isSpinning: isLoading }))] })) })), jsx(Typography, Object.assign({ weight: 'medium', variant: 'title', color: 'primary', className: 'otp-verification-view__title' }, { children: isValid ? 'Verification code confirmed' : 'Confirm verification code' })), jsxs("div", Object.assign({ className: 'otp-verification-view__body' }, { children: [isValid && (jsx(Typography, Object.assign({ variant: 'body_normal', weight: 'regular', color: 'secondary' }, { children: "Hang tight while we get things ready for you" }))), !isValid && (jsxs(Fragment, { children: [jsx(Typography, Object.assign({ variant: 'body_normal', weight: 'regular', color: 'secondary' }, { children: "We\u2019ve sent a verification code to" })), jsxs("div", Object.assign({ className: 'otp-verification-view__email-container' }, { children: [jsx(Typography, Object.assign({ variant: 'body_normal', weight: 'bold', color: 'secondary' }, { children: email })), onClickEditEmail && (jsx(IconButton, Object.assign({ onClick: onClickEditEmail, "data-testid": 'otp-verification-view__edit-button' }, { children: jsx(Icon, Object.assign({ color: 'text-tertiary' }, { children: jsx(SvgPencilAltIcon, {}) })) })))] }))] }))] })), jsx(PinField, { initialValue: Array(6).join('.').split('.'), isLoading: isLoading, handleComplete: onPinComplete, isValidated: isValid, inputMode: 'numeric', pattern: '[0-9]*', hasError: Boolean(error), onChange: onPinChange }), jsxs("div", Object.assign({ className: 'otp-verification-view__footer' }, { children: [termsOfServiceUrl && privacyPolicyUrl && (jsx(TosAndPp, { mode: 'logging in', privacyPolicyUrl: privacyPolicyUrl, termsOfServiceUrl: termsOfServiceUrl })), displayPoweredByDynamic && jsx(PoweredByDynamic, {})] }))] })));
|
|
50
|
+
return (jsxs("div", Object.assign({ className: 'otp-verification-view' }, { children: [jsx(ModalHeaderBanner, { type: 'error', message: error === null || error === void 0 ? void 0 : error.message }), jsx(ModalHeader, Object.assign({ alignContent: 'bottom', leading: onClickBack && backButton }, { children: jsxs("div", Object.assign({ className: 'otp-verification-view__status-header' }, { children: [isValid && (jsx(IconWithStatus, { Icon: SignInWithEmailIcon, iconSize: 50, InnerIcon: SvgCheck })), !isValid && (jsx(IconWithSpinner, { Icon: SignInWithEmailIcon, iconSize: 80, isSpinning: isLoading }))] })) })), jsx(Typography, Object.assign({ weight: 'medium', variant: 'title', color: 'primary', className: 'otp-verification-view__title' }, { children: isValid ? 'Verification code confirmed' : 'Confirm verification code' })), jsxs("div", Object.assign({ className: 'otp-verification-view__body' }, { children: [isValid && (jsx(Typography, Object.assign({ variant: 'body_normal', weight: 'regular', color: 'secondary' }, { children: "Hang tight while we get things ready for you" }))), !isValid && (jsxs(Fragment, { children: [jsx(Typography, Object.assign({ variant: 'body_normal', weight: 'regular', color: 'secondary' }, { children: "We\u2019ve sent a verification code to" })), jsxs("div", Object.assign({ className: 'otp-verification-view__email-container' }, { children: [jsx(Typography, Object.assign({ variant: 'body_normal', weight: 'bold', color: 'secondary' }, { children: shortenEmail(email) })), onClickEditEmail && (jsx(IconButton, Object.assign({ onClick: onClickEditEmail, "data-testid": 'otp-verification-view__edit-button' }, { children: jsx(Icon, Object.assign({ color: 'text-tertiary' }, { children: jsx(SvgPencilAltIcon, {}) })) })))] }))] }))] })), jsx(PinField, { initialValue: Array(6).join('.').split('.'), isLoading: isLoading, handleComplete: onPinComplete, isValidated: isValid, inputMode: 'numeric', pattern: '[0-9]*', hasError: Boolean(error), onChange: onPinChange }), jsxs("div", Object.assign({ className: 'otp-verification-view__footer' }, { children: [termsOfServiceUrl && privacyPolicyUrl && (jsx(TosAndPp, { mode: 'logging in', privacyPolicyUrl: privacyPolicyUrl, termsOfServiceUrl: termsOfServiceUrl })), displayPoweredByDynamic && jsx(PoweredByDynamic, {})] }))] })));
|
|
50
51
|
};
|
|
51
52
|
|
|
52
53
|
export { OTPVerificationView };
|
|
@@ -37,6 +37,6 @@ const getDisplayErrorMessage = (errors, field) => {
|
|
|
37
37
|
}
|
|
38
38
|
return '';
|
|
39
39
|
};
|
|
40
|
-
const SendBalanceForm = ({ initialValues, onSubmit }) => (jsxRuntime.jsx(formik.Formik, Object.assign({ initialValues: initialValues || sendBalanceFormInitialValues, validationSchema: sendBalanceFormValidationSchema, onSubmit: (values) => onSubmit(values), validateOnChange: false, validateOnBlur: false }, { children: ({ errors, touched }) => (jsxRuntime.jsxs(formik.Form, Object.assign({ className: 'send-balance-form' }, { children: [jsxRuntime.jsx(formik.Field, { className: 'send-balance-form__field', name: 'amount', label: 'Amount', placeholder: 'Select amount', as: Input.Input, error: errors['amount'], message: touched['amount'] && getDisplayErrorMessage(errors, 'amount') }), jsxRuntime.jsx(formik.Field, { className: 'send-balance-form__field', placeholder: 'Enter wallet address...', label: 'Recipient', id: 'recipient', name: 'recipient', as: Input.Input, error: errors['recipient'], message: touched['recipient'] && getDisplayErrorMessage(errors, 'recipient') }), jsxRuntime.jsx(Button.Button, Object.assign({ dataTestId: 'sendBalanceFormSubmitButton', expanded: true, type: 'submit', buttonVariant: 'primary', buttonPadding: 'large', buttonRounded: 'default', buttonClassName: 'send-balance-form__button' }, { children: "Send now" }))] }))) })));
|
|
40
|
+
const SendBalanceForm = ({ initialValues, onSubmit }) => (jsxRuntime.jsx(formik.Formik, Object.assign({ initialValues: initialValues || sendBalanceFormInitialValues, validationSchema: sendBalanceFormValidationSchema, onSubmit: (values) => onSubmit(values), validateOnChange: false, validateOnBlur: false }, { children: ({ errors, touched }) => (jsxRuntime.jsxs(formik.Form, Object.assign({ className: 'send-balance-form' }, { children: [jsxRuntime.jsx(formik.Field, { variant: 'regular', className: 'send-balance-form__field', name: 'amount', label: 'Amount', placeholder: 'Select amount', as: Input.Input, error: errors['amount'], message: touched['amount'] && getDisplayErrorMessage(errors, 'amount') }), jsxRuntime.jsx(formik.Field, { variant: 'regular', className: 'send-balance-form__field', placeholder: 'Enter wallet address...', label: 'Recipient', id: 'recipient', name: 'recipient', as: Input.Input, error: errors['recipient'], message: touched['recipient'] && getDisplayErrorMessage(errors, 'recipient') }), jsxRuntime.jsx(Button.Button, Object.assign({ dataTestId: 'sendBalanceFormSubmitButton', expanded: true, type: 'submit', buttonVariant: 'primary', buttonPadding: 'large', buttonRounded: 'default', buttonClassName: 'send-balance-form__button' }, { children: "Send now" }))] }))) })));
|
|
41
41
|
|
|
42
42
|
exports.SendBalanceForm = SendBalanceForm;
|
|
@@ -33,6 +33,6 @@ const getDisplayErrorMessage = (errors, field) => {
|
|
|
33
33
|
}
|
|
34
34
|
return '';
|
|
35
35
|
};
|
|
36
|
-
const SendBalanceForm = ({ initialValues, onSubmit }) => (jsx(Formik, Object.assign({ initialValues: initialValues || sendBalanceFormInitialValues, validationSchema: sendBalanceFormValidationSchema, onSubmit: (values) => onSubmit(values), validateOnChange: false, validateOnBlur: false }, { children: ({ errors, touched }) => (jsxs(Form, Object.assign({ className: 'send-balance-form' }, { children: [jsx(Field, { className: 'send-balance-form__field', name: 'amount', label: 'Amount', placeholder: 'Select amount', as: Input, error: errors['amount'], message: touched['amount'] && getDisplayErrorMessage(errors, 'amount') }), jsx(Field, { className: 'send-balance-form__field', placeholder: 'Enter wallet address...', label: 'Recipient', id: 'recipient', name: 'recipient', as: Input, error: errors['recipient'], message: touched['recipient'] && getDisplayErrorMessage(errors, 'recipient') }), jsx(Button, Object.assign({ dataTestId: 'sendBalanceFormSubmitButton', expanded: true, type: 'submit', buttonVariant: 'primary', buttonPadding: 'large', buttonRounded: 'default', buttonClassName: 'send-balance-form__button' }, { children: "Send now" }))] }))) })));
|
|
36
|
+
const SendBalanceForm = ({ initialValues, onSubmit }) => (jsx(Formik, Object.assign({ initialValues: initialValues || sendBalanceFormInitialValues, validationSchema: sendBalanceFormValidationSchema, onSubmit: (values) => onSubmit(values), validateOnChange: false, validateOnBlur: false }, { children: ({ errors, touched }) => (jsxs(Form, Object.assign({ className: 'send-balance-form' }, { children: [jsx(Field, { variant: 'regular', className: 'send-balance-form__field', name: 'amount', label: 'Amount', placeholder: 'Select amount', as: Input, error: errors['amount'], message: touched['amount'] && getDisplayErrorMessage(errors, 'amount') }), jsx(Field, { variant: 'regular', className: 'send-balance-form__field', placeholder: 'Enter wallet address...', label: 'Recipient', id: 'recipient', name: 'recipient', as: Input, error: errors['recipient'], message: touched['recipient'] && getDisplayErrorMessage(errors, 'recipient') }), jsx(Button, Object.assign({ dataTestId: 'sendBalanceFormSubmitButton', expanded: true, type: 'submit', buttonVariant: 'primary', buttonPadding: 'large', buttonRounded: 'default', buttonClassName: 'send-balance-form__button' }, { children: "Send now" }))] }))) })));
|
|
37
37
|
|
|
38
38
|
export { SendBalanceForm };
|
|
@@ -30,12 +30,13 @@ var VerticalDrawerTransition = require('../Transition/VerticalDrawerTransition/V
|
|
|
30
30
|
var Alert = require('../Alert/Alert.cjs');
|
|
31
31
|
var SendBalanceForm = require('../SendBalanceForm/SendBalanceForm.cjs');
|
|
32
32
|
var Chip = require('../Chip/Chip.cjs');
|
|
33
|
+
var FormFieldLabel = require('../FormFieldLabel/FormFieldLabel.cjs');
|
|
33
34
|
var TokenBalanceCard = require('./components/TokenBalanceCard/TokenBalanceCard.cjs');
|
|
34
35
|
|
|
35
36
|
const SendBalancePageLayout = ({ error, walletAddress, onClickClose, onClickBack, walletName, onSubmit, displayPoweredByDynamicFooter = false, balance, chain, currencySymbol, initialValues, networkName, networkIcon, }) => {
|
|
36
37
|
const closeButton = onClickClose && (jsxRuntime.jsx(IconButton.IconButton, Object.assign({ type: 'button', onClick: onClickClose, "data-testid": 'close-button' }, { children: jsxRuntime.jsx(close.ReactComponent, {}) })));
|
|
37
38
|
const backButton = onClickBack && (jsxRuntime.jsx(IconButton.IconButton, Object.assign({ type: 'button', onClick: onClickBack, "data-testid": 'back-button' }, { children: jsxRuntime.jsx(chevronLeft.ReactComponent, {}) })));
|
|
38
|
-
return (jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx(ModalHeader.ModalHeader, Object.assign({ leading: backButton, trailing: closeButton }, { children: jsxRuntime.jsxs("div", Object.assign({ className: 'send-balance-page-layout__header-content' }, { children: [jsxRuntime.jsx(Typography.Typography, Object.assign({ variant: 'body_normal', color: 'primary', as: 'p' }, { children: "Send from" })), walletName && (jsxRuntime.jsx(Icon.Icon, Object.assign({ size: 'small' }, { children: jsxRuntime.jsx(walletBook.WalletIcon, { walletName: walletName }) }))), jsxRuntime.jsx(Typography.Typography, Object.assign({ variant: 'body_normal', color: 'primary', as: 'p' }, { children: shortenWalletAddress.shortenWalletAddress(walletAddress, 3, 3) }))] })) })), jsxRuntime.jsxs("div", Object.assign({ className: 'send-balance-page-layout__body' }, { children: [jsxRuntime.jsx(AnimatePresence.AnimatePresence, Object.assign({ animationComponent: jsxRuntime.jsx(VerticalDrawerTransition.VerticalDrawerTransition, {}) }, { children: error && (jsxRuntime.jsx("div", Object.assign({ className: 'send-balance-page-layout__error' }, { children: jsxRuntime.jsx(Alert.Alert, Object.assign({ icon: 'error', variant: 'error' }, { children: error })) }))) })), networkName && networkIcon && (jsxRuntime.jsx("div", Object.assign({ className: 'send-balance-page-layout__network-container' }, { children: jsxRuntime.jsx(Chip.Chip, Object.assign({ icon: networkIcon }, { children: networkName })) }))), jsxRuntime.jsx(TokenBalanceCard.TokenBalanceCard, { chain: chain, currencySymbol: currencySymbol, balance: balance }), jsxRuntime.jsx(SendBalanceForm.SendBalanceForm, { onSubmit: onSubmit, initialValues: initialValues }), displayPoweredByDynamicFooter && (jsxRuntime.jsx("div", Object.assign({ className: 'send-balance-page-layout__footer' }, { children: jsxRuntime.jsx(PoweredByDynamic.PoweredByDynamic, {}) })))] }))] }));
|
|
39
|
+
return (jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx(ModalHeader.ModalHeader, Object.assign({ leading: backButton, trailing: closeButton }, { children: jsxRuntime.jsxs("div", Object.assign({ className: 'send-balance-page-layout__header-content' }, { children: [jsxRuntime.jsx(Typography.Typography, Object.assign({ variant: 'body_normal', color: 'primary', as: 'p' }, { children: "Send from" })), walletName && (jsxRuntime.jsx(Icon.Icon, Object.assign({ size: 'small' }, { children: jsxRuntime.jsx(walletBook.WalletIcon, { walletName: walletName }) }))), jsxRuntime.jsx(Typography.Typography, Object.assign({ variant: 'body_normal', color: 'primary', as: 'p' }, { children: shortenWalletAddress.shortenWalletAddress(walletAddress, 3, 3) }))] })) })), jsxRuntime.jsxs("div", Object.assign({ className: 'send-balance-page-layout__body' }, { children: [jsxRuntime.jsx(AnimatePresence.AnimatePresence, Object.assign({ animationComponent: jsxRuntime.jsx(VerticalDrawerTransition.VerticalDrawerTransition, {}) }, { children: error && (jsxRuntime.jsx("div", Object.assign({ className: 'send-balance-page-layout__error' }, { children: jsxRuntime.jsx(Alert.Alert, Object.assign({ icon: 'error', variant: 'error' }, { children: error })) }))) })), networkName && networkIcon && (jsxRuntime.jsx("div", Object.assign({ className: 'send-balance-page-layout__network-container' }, { children: jsxRuntime.jsx(Chip.Chip, Object.assign({ icon: networkIcon }, { children: networkName })) }))), jsxRuntime.jsxs("div", Object.assign({ className: 'send-balance-page-layout__balance-container' }, { children: [jsxRuntime.jsx(FormFieldLabel.FormFieldLabel, Object.assign({ divider: true }, { children: "Token" })), jsxRuntime.jsx(TokenBalanceCard.TokenBalanceCard, { chain: chain, currencySymbol: currencySymbol, balance: balance })] })), jsxRuntime.jsx(SendBalanceForm.SendBalanceForm, { onSubmit: onSubmit, initialValues: initialValues }), displayPoweredByDynamicFooter && (jsxRuntime.jsx("div", Object.assign({ className: 'send-balance-page-layout__footer' }, { children: jsxRuntime.jsx(PoweredByDynamic.PoweredByDynamic, {}) })))] }))] }));
|
|
39
40
|
};
|
|
40
41
|
|
|
41
42
|
exports.SendBalancePageLayout = SendBalancePageLayout;
|
|
@@ -26,12 +26,13 @@ import { VerticalDrawerTransition } from '../Transition/VerticalDrawerTransition
|
|
|
26
26
|
import { Alert } from '../Alert/Alert.js';
|
|
27
27
|
import { SendBalanceForm } from '../SendBalanceForm/SendBalanceForm.js';
|
|
28
28
|
import { Chip } from '../Chip/Chip.js';
|
|
29
|
+
import { FormFieldLabel } from '../FormFieldLabel/FormFieldLabel.js';
|
|
29
30
|
import { TokenBalanceCard } from './components/TokenBalanceCard/TokenBalanceCard.js';
|
|
30
31
|
|
|
31
32
|
const SendBalancePageLayout = ({ error, walletAddress, onClickClose, onClickBack, walletName, onSubmit, displayPoweredByDynamicFooter = false, balance, chain, currencySymbol, initialValues, networkName, networkIcon, }) => {
|
|
32
33
|
const closeButton = onClickClose && (jsx(IconButton, Object.assign({ type: 'button', onClick: onClickClose, "data-testid": 'close-button' }, { children: jsx(SvgClose, {}) })));
|
|
33
34
|
const backButton = onClickBack && (jsx(IconButton, Object.assign({ type: 'button', onClick: onClickBack, "data-testid": 'back-button' }, { children: jsx(SvgChevronLeft, {}) })));
|
|
34
|
-
return (jsxs("div", { children: [jsx(ModalHeader, Object.assign({ leading: backButton, trailing: closeButton }, { children: jsxs("div", Object.assign({ className: 'send-balance-page-layout__header-content' }, { children: [jsx(Typography, Object.assign({ variant: 'body_normal', color: 'primary', as: 'p' }, { children: "Send from" })), walletName && (jsx(Icon, Object.assign({ size: 'small' }, { children: jsx(WalletIcon, { walletName: walletName }) }))), jsx(Typography, Object.assign({ variant: 'body_normal', color: 'primary', as: 'p' }, { children: shortenWalletAddress(walletAddress, 3, 3) }))] })) })), jsxs("div", Object.assign({ className: 'send-balance-page-layout__body' }, { children: [jsx(AnimatePresence, Object.assign({ animationComponent: jsx(VerticalDrawerTransition, {}) }, { children: error && (jsx("div", Object.assign({ className: 'send-balance-page-layout__error' }, { children: jsx(Alert, Object.assign({ icon: 'error', variant: 'error' }, { children: error })) }))) })), networkName && networkIcon && (jsx("div", Object.assign({ className: 'send-balance-page-layout__network-container' }, { children: jsx(Chip, Object.assign({ icon: networkIcon }, { children: networkName })) }))), jsx(TokenBalanceCard, { chain: chain, currencySymbol: currencySymbol, balance: balance }), jsx(SendBalanceForm, { onSubmit: onSubmit, initialValues: initialValues }), displayPoweredByDynamicFooter && (jsx("div", Object.assign({ className: 'send-balance-page-layout__footer' }, { children: jsx(PoweredByDynamic, {}) })))] }))] }));
|
|
35
|
+
return (jsxs("div", { children: [jsx(ModalHeader, Object.assign({ leading: backButton, trailing: closeButton }, { children: jsxs("div", Object.assign({ className: 'send-balance-page-layout__header-content' }, { children: [jsx(Typography, Object.assign({ variant: 'body_normal', color: 'primary', as: 'p' }, { children: "Send from" })), walletName && (jsx(Icon, Object.assign({ size: 'small' }, { children: jsx(WalletIcon, { walletName: walletName }) }))), jsx(Typography, Object.assign({ variant: 'body_normal', color: 'primary', as: 'p' }, { children: shortenWalletAddress(walletAddress, 3, 3) }))] })) })), jsxs("div", Object.assign({ className: 'send-balance-page-layout__body' }, { children: [jsx(AnimatePresence, Object.assign({ animationComponent: jsx(VerticalDrawerTransition, {}) }, { children: error && (jsx("div", Object.assign({ className: 'send-balance-page-layout__error' }, { children: jsx(Alert, Object.assign({ icon: 'error', variant: 'error' }, { children: error })) }))) })), networkName && networkIcon && (jsx("div", Object.assign({ className: 'send-balance-page-layout__network-container' }, { children: jsx(Chip, Object.assign({ icon: networkIcon }, { children: networkName })) }))), jsxs("div", Object.assign({ className: 'send-balance-page-layout__balance-container' }, { children: [jsx(FormFieldLabel, Object.assign({ divider: true }, { children: "Token" })), jsx(TokenBalanceCard, { chain: chain, currencySymbol: currencySymbol, balance: balance })] })), jsx(SendBalanceForm, { onSubmit: onSubmit, initialValues: initialValues }), displayPoweredByDynamicFooter && (jsx("div", Object.assign({ className: 'send-balance-page-layout__footer' }, { children: jsx(PoweredByDynamic, {}) })))] }))] }));
|
|
35
36
|
};
|
|
36
37
|
|
|
37
38
|
export { SendBalancePageLayout };
|
|
@@ -41,7 +41,7 @@ var VerifiedEmailIcon = require('./components/VerifiedEmailIcon/VerifiedEmailIco
|
|
|
41
41
|
const UserProfileField = ({ name, label, value, }) => {
|
|
42
42
|
const isEmpty = value === '';
|
|
43
43
|
const isEmailField = name === 'email';
|
|
44
|
-
return (jsxRuntime.jsxs("div", Object.assign({ className: 'user-profile-field' }, { children: [label && (jsxRuntime.jsx(Typography.Typography, Object.assign({ as: 'h6', color: 'secondary', weight: 'regular', variant: 'body_small' }, { children: label }))), jsxRuntime.jsx(Typography.Typography, Object.assign({ color: isEmpty ? 'tertiary' : 'primary', as: '
|
|
44
|
+
return (jsxRuntime.jsxs("div", Object.assign({ className: 'user-profile-field' }, { children: [label && (jsxRuntime.jsx(Typography.Typography, Object.assign({ as: 'h6', color: 'secondary', weight: 'regular', variant: 'body_small' }, { children: label }))), jsxRuntime.jsxs("div", Object.assign({ className: 'user-profile-field__value' }, { children: [jsxRuntime.jsx(Typography.Typography, Object.assign({ color: isEmpty ? 'tertiary' : 'primary', as: 'p', weight: 'regular', variant: 'body_normal' }, { children: value || 'Empty' })), isEmailField && (jsxRuntime.jsx(VerifiedEmailIcon.VerifiedEmailIcon, { className: 'user-profile-field__verify-email-icon', overwriteTooltipProps: { as: 'div' } }))] }))] })));
|
|
45
45
|
};
|
|
46
46
|
|
|
47
47
|
exports.UserProfileField = UserProfileField;
|
|
@@ -37,7 +37,7 @@ import { VerifiedEmailIcon } from './components/VerifiedEmailIcon/VerifiedEmailI
|
|
|
37
37
|
const UserProfileField = ({ name, label, value, }) => {
|
|
38
38
|
const isEmpty = value === '';
|
|
39
39
|
const isEmailField = name === 'email';
|
|
40
|
-
return (jsxs("div", Object.assign({ className: 'user-profile-field' }, { children: [label && (jsx(Typography, Object.assign({ as: 'h6', color: 'secondary', weight: 'regular', variant: 'body_small' }, { children: label }))), jsx(Typography, Object.assign({ color: isEmpty ? 'tertiary' : 'primary', as: '
|
|
40
|
+
return (jsxs("div", Object.assign({ className: 'user-profile-field' }, { children: [label && (jsx(Typography, Object.assign({ as: 'h6', color: 'secondary', weight: 'regular', variant: 'body_small' }, { children: label }))), jsxs("div", Object.assign({ className: 'user-profile-field__value' }, { children: [jsx(Typography, Object.assign({ color: isEmpty ? 'tertiary' : 'primary', as: 'p', weight: 'regular', variant: 'body_normal' }, { children: value || 'Empty' })), isEmailField && (jsx(VerifiedEmailIcon, { className: 'user-profile-field__verify-email-icon', overwriteTooltipProps: { as: 'div' } }))] }))] })));
|
|
41
41
|
};
|
|
42
42
|
|
|
43
43
|
export { UserProfileField };
|
|
@@ -20,14 +20,14 @@ var Tooltip = require('../../../../../Tooltip/Tooltip.cjs');
|
|
|
20
20
|
var Typography = require('../../../../../Typography/Typography.cjs');
|
|
21
21
|
|
|
22
22
|
const VerifiedEmailTooltip = (jsxRuntime.jsx(Typography.Typography, Object.assign({ variant: 'numbers_small', color: 'tooltip' }, { children: "This email is verified" })));
|
|
23
|
-
const VerifiedEmailIcon = ({ className, }) => {
|
|
23
|
+
const VerifiedEmailIcon = ({ className, overwriteTooltipProps, }) => {
|
|
24
24
|
const { user } = useInternalDynamicContext.useInternalDynamicContext();
|
|
25
25
|
if (!(user === null || user === void 0 ? void 0 : user.email))
|
|
26
26
|
return null;
|
|
27
27
|
const isVerified = user === null || user === void 0 ? void 0 : user.verifiedCredentials.some(({ email }) => email === user.email);
|
|
28
28
|
if (!isVerified)
|
|
29
29
|
return null;
|
|
30
|
-
return (jsxRuntime.jsx(Tooltip.Tooltip, Object.assign({ content: VerifiedEmailTooltip }, { children: jsxRuntime.jsx(checkCircle.ReactComponent, { className: classNames.classNames('dynamic-verified-email-icon', className) }) })));
|
|
30
|
+
return (jsxRuntime.jsx(Tooltip.Tooltip, Object.assign({ content: VerifiedEmailTooltip }, overwriteTooltipProps, { children: jsxRuntime.jsx(checkCircle.ReactComponent, { className: classNames.classNames('dynamic-verified-email-icon', className) }) })));
|
|
31
31
|
};
|
|
32
32
|
|
|
33
33
|
exports.VerifiedEmailIcon = VerifiedEmailIcon;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
+
import { TooltipProps } from '../../../../../Tooltip/Tooltip';
|
|
2
3
|
export type VerifiedEmailIconProps = {
|
|
3
4
|
className?: string;
|
|
5
|
+
overwriteTooltipProps?: Partial<TooltipProps>;
|
|
4
6
|
};
|
|
5
7
|
export declare const VerifiedEmailIcon: FC<VerifiedEmailIconProps>;
|
|
@@ -16,14 +16,14 @@ import { Tooltip } from '../../../../../Tooltip/Tooltip.js';
|
|
|
16
16
|
import { Typography } from '../../../../../Typography/Typography.js';
|
|
17
17
|
|
|
18
18
|
const VerifiedEmailTooltip = (jsx(Typography, Object.assign({ variant: 'numbers_small', color: 'tooltip' }, { children: "This email is verified" })));
|
|
19
|
-
const VerifiedEmailIcon = ({ className, }) => {
|
|
19
|
+
const VerifiedEmailIcon = ({ className, overwriteTooltipProps, }) => {
|
|
20
20
|
const { user } = useInternalDynamicContext();
|
|
21
21
|
if (!(user === null || user === void 0 ? void 0 : user.email))
|
|
22
22
|
return null;
|
|
23
23
|
const isVerified = user === null || user === void 0 ? void 0 : user.verifiedCredentials.some(({ email }) => email === user.email);
|
|
24
24
|
if (!isVerified)
|
|
25
25
|
return null;
|
|
26
|
-
return (jsx(Tooltip, Object.assign({ content: VerifiedEmailTooltip }, { children: jsx(SvgCheckCircle, { className: classNames('dynamic-verified-email-icon', className) }) })));
|
|
26
|
+
return (jsx(Tooltip, Object.assign({ content: VerifiedEmailTooltip }, overwriteTooltipProps, { children: jsx(SvgCheckCircle, { className: classNames('dynamic-verified-email-icon', className) }) })));
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
export { VerifiedEmailIcon };
|
package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.cjs
CHANGED
|
@@ -8,7 +8,7 @@ var React = require('react');
|
|
|
8
8
|
var iconic = require('@dynamic-labs/iconic');
|
|
9
9
|
var Typography = require('../../../Typography/Typography.cjs');
|
|
10
10
|
require('@dynamic-labs/sdk-api');
|
|
11
|
-
require('../../../../shared/logger.cjs');
|
|
11
|
+
var logger = require('../../../../shared/logger.cjs');
|
|
12
12
|
require('@dynamic-labs/wallet-connector-core');
|
|
13
13
|
require('../../../../context/ViewContext/ViewContext.cjs');
|
|
14
14
|
var add = require('../../../../shared/assets/add.cjs');
|
|
@@ -80,14 +80,23 @@ const UserProfileSocialAccount = ({ provider, authorizationUrl, verifiedCredenti
|
|
|
80
80
|
};
|
|
81
81
|
const disconnectAccount = () => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
82
82
|
var _c;
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
83
|
+
try {
|
|
84
|
+
setLoading(true);
|
|
85
|
+
const jwt = yield api.unlinkOAuth({
|
|
86
|
+
environmentId,
|
|
87
|
+
verifiedCrentialId: (_c = verifiedCredential === null || verifiedCredential === void 0 ? void 0 : verifiedCredential.id) !== null && _c !== void 0 ? _c : '',
|
|
88
|
+
}, String(authToken || onboardingOnlyJwt));
|
|
89
|
+
if (!jwt) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
updateUserProfileByJWT(jwt);
|
|
93
|
+
}
|
|
94
|
+
catch (err) {
|
|
95
|
+
logger.logger.error(err);
|
|
96
|
+
}
|
|
97
|
+
finally {
|
|
98
|
+
setLoading(false);
|
|
89
99
|
}
|
|
90
|
-
updateUserProfileByJWT(jwt);
|
|
91
100
|
});
|
|
92
101
|
if (!verifiedCredential && !authorizationUrl) {
|
|
93
102
|
return null;
|
|
@@ -103,7 +112,7 @@ const UserProfileSocialAccount = ({ provider, authorizationUrl, verifiedCredenti
|
|
|
103
112
|
weight: 'medium',
|
|
104
113
|
}, startSlot:
|
|
105
114
|
// eslint-disable-next-line react/jsx-wrap-multilines
|
|
106
|
-
jsxRuntime.jsx(Icon.Icon, Object.assign({ color: 'text-tertiary', size: '
|
|
115
|
+
jsxRuntime.jsx(Icon.Icon, Object.assign({ color: 'text-tertiary', size: 'small' }, { children: jsxRuntime.jsx(add.ReactComponent, {}) })) }, { children: "Connect" })))] })));
|
|
107
116
|
};
|
|
108
117
|
|
|
109
118
|
exports.UserProfileSocialAccount = UserProfileSocialAccount;
|