@dynamic-labs/sdk-react-core 0.17.0-RC.25 → 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 +14 -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/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/UserProfileSocialAccount/UserProfileSocialAccount.cjs +17 -8
- package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.js +17 -8
- package/src/lib/components/index.d.ts +1 -0
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/views/CollectUserDataView/CollectUserDataView.cjs +2 -2
- package/src/lib/views/CollectUserDataView/CollectUserDataView.js +2 -2
- 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 +2 -2
- package/src/lib/widgets/DynamicWidget/components/AccountControl/AccountControl.js +2 -2
- 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 +2 -2
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetWalletHeader/DynamicWidgetWalletHeader.js +3 -3
- package/src/lib/widgets/DynamicWidget/components/Wallet/Wallet.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/components/Wallet/Wallet.js +2 -2
- 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,18 @@
|
|
|
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
|
+
|
|
2
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)
|
|
3
17
|
|
|
4
18
|
|
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 };
|
|
@@ -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 };
|
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;
|
package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.js
CHANGED
|
@@ -4,7 +4,7 @@ import { useState } from 'react';
|
|
|
4
4
|
import { SocialIcon } from '@dynamic-labs/iconic';
|
|
5
5
|
import { Typography } from '../../../Typography/Typography.js';
|
|
6
6
|
import '@dynamic-labs/sdk-api';
|
|
7
|
-
import '../../../../shared/logger.js';
|
|
7
|
+
import { logger } from '../../../../shared/logger.js';
|
|
8
8
|
import '@dynamic-labs/wallet-connector-core';
|
|
9
9
|
import '../../../../context/ViewContext/ViewContext.js';
|
|
10
10
|
import { ReactComponent as SvgAdd } from '../../../../shared/assets/add.js';
|
|
@@ -76,14 +76,23 @@ const UserProfileSocialAccount = ({ provider, authorizationUrl, verifiedCredenti
|
|
|
76
76
|
};
|
|
77
77
|
const disconnectAccount = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
78
78
|
var _c;
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
79
|
+
try {
|
|
80
|
+
setLoading(true);
|
|
81
|
+
const jwt = yield unlinkOAuth({
|
|
82
|
+
environmentId,
|
|
83
|
+
verifiedCrentialId: (_c = verifiedCredential === null || verifiedCredential === void 0 ? void 0 : verifiedCredential.id) !== null && _c !== void 0 ? _c : '',
|
|
84
|
+
}, String(authToken || onboardingOnlyJwt));
|
|
85
|
+
if (!jwt) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
updateUserProfileByJWT(jwt);
|
|
89
|
+
}
|
|
90
|
+
catch (err) {
|
|
91
|
+
logger.error(err);
|
|
92
|
+
}
|
|
93
|
+
finally {
|
|
94
|
+
setLoading(false);
|
|
85
95
|
}
|
|
86
|
-
updateUserProfileByJWT(jwt);
|
|
87
96
|
});
|
|
88
97
|
if (!verifiedCredential && !authorizationUrl) {
|
|
89
98
|
return null;
|