@dynamic-labs/sdk-react-core 1.0.7 → 1.0.9
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 +15 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +10 -10
- package/src/lib/Main.cjs +1 -1
- package/src/lib/Main.js +1 -1
- package/src/lib/components/InlineWidget/components/InlineWidgetButton/InlineWidgetButton.d.ts +2 -1
- package/src/lib/components/WalletInformationCard/WalletInformationCard.cjs +3 -1
- package/src/lib/components/WalletInformationCard/WalletInformationCard.d.ts +2 -1
- package/src/lib/components/WalletInformationCard/WalletInformationCard.js +3 -1
- package/src/lib/data/api.cjs +3 -0
- package/src/lib/data/api.js +3 -0
- package/src/lib/locale/en/translation.cjs +34 -0
- package/src/lib/locale/en/translation.d.ts +34 -0
- package/src/lib/locale/en/translation.js +34 -0
- package/src/lib/widgets/DynamicBridgeWidget/DynamicBridgeWidget.cjs +3 -2
- package/src/lib/widgets/DynamicBridgeWidget/DynamicBridgeWidget.js +3 -2
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWalletCard/DynamicBridgeWalletCard.cjs +10 -5
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWalletCard/DynamicBridgeWalletCard.js +11 -6
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWalletCardBody/DynamicBridgeWalletCardBody.cjs +6 -5
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWalletCardBody/DynamicBridgeWalletCardBody.js +6 -5
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWidgetEmptyCard/DynamicBridgeWidgetEmptyCard.cjs +5 -2
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWidgetEmptyCard/DynamicBridgeWidgetEmptyCard.js +5 -2
- package/src/lib/widgets/DynamicBridgeWidget/views/ProfileView/ProfileView.cjs +3 -1
- package/src/lib/widgets/DynamicBridgeWidget/views/ProfileView/ProfileView.js +3 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,19 @@
|
|
|
1
1
|
|
|
2
|
+
### [1.0.9](https://github.com/dynamic-labs/DynamicAuth/compare/v1.0.8...v1.0.9) (2024-01-31)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
* lock starknet to 5.25.0 since 5.27.0 breaks the build ([#4542](https://github.com/dynamic-labs/DynamicAuth/issues/4542)) ([6189e93](https://github.com/dynamic-labs/DynamicAuth/commit/6189e9323776649e61e3a4f0d70a61fc77b5d21f))
|
|
8
|
+
* properly handle AccountExistsError for signInOAuth ([#4530](https://github.com/dynamic-labs/DynamicAuth/issues/4530)) ([9f4e31c](https://github.com/dynamic-labs/DynamicAuth/commit/9f4e31c3c451557ae0c64cb743c61c0da8654e45))
|
|
9
|
+
|
|
10
|
+
### [1.0.8](https://github.com/dynamic-labs/DynamicAuth/compare/v1.0.7...v1.0.8) (2024-01-26)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* pass id to wagmi chain override ([#4512](https://github.com/dynamic-labs/DynamicAuth/issues/4512)) ([#4514](https://github.com/dynamic-labs/DynamicAuth/issues/4514)) ([0e6da01](https://github.com/dynamic-labs/DynamicAuth/commit/0e6da0108d30b9ae65062126f4a41543740acc87))
|
|
16
|
+
|
|
2
17
|
### [1.0.7](https://github.com/dynamic-labs/DynamicAuth/compare/v1.0.6...v1.0.7) (2024-01-25)
|
|
3
18
|
|
|
4
19
|
|
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": "1.0.
|
|
3
|
+
"version": "1.0.9",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/dynamic-labs/DynamicAuth.git",
|
|
@@ -17,15 +17,15 @@
|
|
|
17
17
|
"react-focus-lock": "2.9.2",
|
|
18
18
|
"react-i18next": "^13.2.0",
|
|
19
19
|
"yup": "0.32.11",
|
|
20
|
-
"@dynamic-labs/ethereum": "1.0.
|
|
21
|
-
"@dynamic-labs/logger": "1.0.
|
|
22
|
-
"@dynamic-labs/multi-wallet": "1.0.
|
|
23
|
-
"@dynamic-labs/rpc-providers": "1.0.
|
|
24
|
-
"@dynamic-labs/types": "1.0.
|
|
25
|
-
"@dynamic-labs/utils": "1.0.
|
|
26
|
-
"@dynamic-labs/viem-utils": "1.0.
|
|
27
|
-
"@dynamic-labs/wallet-book": "1.0.
|
|
28
|
-
"@dynamic-labs/wallet-connector-core": "1.0.
|
|
20
|
+
"@dynamic-labs/ethereum": "1.0.9",
|
|
21
|
+
"@dynamic-labs/logger": "1.0.9",
|
|
22
|
+
"@dynamic-labs/multi-wallet": "1.0.9",
|
|
23
|
+
"@dynamic-labs/rpc-providers": "1.0.9",
|
|
24
|
+
"@dynamic-labs/types": "1.0.9",
|
|
25
|
+
"@dynamic-labs/utils": "1.0.9",
|
|
26
|
+
"@dynamic-labs/viem-utils": "1.0.9",
|
|
27
|
+
"@dynamic-labs/wallet-book": "1.0.9",
|
|
28
|
+
"@dynamic-labs/wallet-connector-core": "1.0.9",
|
|
29
29
|
"eventemitter3": "5.0.1"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
package/src/lib/Main.cjs
CHANGED
|
@@ -24,6 +24,7 @@ var index$1 = require('./shared/consts/index.cjs');
|
|
|
24
24
|
require('./context/DynamicContext/DynamicContext.cjs');
|
|
25
25
|
var useInternalDynamicContext = require('./context/DynamicContext/useInternalDynamicContext.cjs');
|
|
26
26
|
var UserWalletsContext = require('./context/UserWalletsContext/UserWalletsContext.cjs');
|
|
27
|
+
require('react-i18next');
|
|
27
28
|
require('./context/CaptchaContext/CaptchaContext.cjs');
|
|
28
29
|
require('./context/ErrorContext/ErrorContext.cjs');
|
|
29
30
|
var isSupportedNetwork = require('./utils/functions/isSupportedNetwork/isSupportedNetwork.cjs');
|
|
@@ -37,7 +38,6 @@ var isSameWalletName = require('./utils/functions/isSameWalletName/isSameWalletN
|
|
|
37
38
|
require('./context/ThemeContext/ThemeContext.cjs');
|
|
38
39
|
require('@dynamic-labs/types');
|
|
39
40
|
require('yup');
|
|
40
|
-
require('react-i18next');
|
|
41
41
|
require('./context/MockContext/MockContext.cjs');
|
|
42
42
|
require('./utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.cjs');
|
|
43
43
|
require('./context/UserFieldEditorContext/UserFieldEditorContext.cjs');
|
package/src/lib/Main.js
CHANGED
|
@@ -20,6 +20,7 @@ import { authModalZIndex } from './shared/consts/index.js';
|
|
|
20
20
|
import './context/DynamicContext/DynamicContext.js';
|
|
21
21
|
import { useInternalDynamicContext } from './context/DynamicContext/useInternalDynamicContext.js';
|
|
22
22
|
import { useUserWallets } from './context/UserWalletsContext/UserWalletsContext.js';
|
|
23
|
+
import 'react-i18next';
|
|
23
24
|
import './context/CaptchaContext/CaptchaContext.js';
|
|
24
25
|
import './context/ErrorContext/ErrorContext.js';
|
|
25
26
|
import { isSupportedNetwork } from './utils/functions/isSupportedNetwork/isSupportedNetwork.js';
|
|
@@ -33,7 +34,6 @@ import { isSameWalletName } from './utils/functions/isSameWalletName/isSameWalle
|
|
|
33
34
|
import './context/ThemeContext/ThemeContext.js';
|
|
34
35
|
import '@dynamic-labs/types';
|
|
35
36
|
import 'yup';
|
|
36
|
-
import 'react-i18next';
|
|
37
37
|
import './context/MockContext/MockContext.js';
|
|
38
38
|
import './utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.js';
|
|
39
39
|
import './context/UserFieldEditorContext/UserFieldEditorContext.js';
|
package/src/lib/components/InlineWidget/components/InlineWidgetButton/InlineWidgetButton.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { FC, MouseEventHandler, PropsWithChildren, ReactElement } from 'react';
|
|
2
|
+
import { CopyKey } from '../../../../shared';
|
|
2
3
|
type InlineWidgetButtonProps = {
|
|
3
4
|
onClick?: MouseEventHandler<HTMLButtonElement>;
|
|
4
5
|
icon?: ReactElement;
|
|
5
6
|
className?: string;
|
|
6
|
-
};
|
|
7
|
+
} & CopyKey;
|
|
7
8
|
export declare const InlineWidgetButton: FC<PropsWithChildren<InlineWidgetButtonProps>>;
|
|
8
9
|
export {};
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
var React = require('react');
|
|
7
|
+
var reactI18next = require('react-i18next');
|
|
7
8
|
var Typography = require('../Typography/Typography.cjs');
|
|
8
9
|
require('@dynamic-labs/sdk-api');
|
|
9
10
|
require('../../shared/logger.cjs');
|
|
@@ -20,6 +21,7 @@ require('../../shared/consts/index.cjs');
|
|
|
20
21
|
var Icon = require('../Icon/Icon.cjs');
|
|
21
22
|
|
|
22
23
|
const WalletInformationCard = ({ address, ens, balance, icon, network, menu, }) => {
|
|
24
|
+
const { t } = reactI18next.useTranslation();
|
|
23
25
|
const details = React.useMemo(() => {
|
|
24
26
|
const shortenAddress = shortenWalletAddress.shortenWalletAddress(address, 4, 4);
|
|
25
27
|
if (ens) {
|
|
@@ -27,7 +29,7 @@ const WalletInformationCard = ({ address, ens, balance, icon, network, menu, })
|
|
|
27
29
|
}
|
|
28
30
|
return (jsxRuntime.jsx(Typography.Typography, { weight: 'medium', variant: 'body_normal', color: 'primary', children: shortenAddress }));
|
|
29
31
|
}, [ens, address]);
|
|
30
|
-
return (jsxRuntime.jsxs("div", { className: 'wallet-information-card', children: [jsxRuntime.jsxs("div", { className: 'wallet-information-card__header', children: [jsxRuntime.jsxs("div", { className: 'wallet-information-card__details-container', children: [icon && (jsxRuntime.jsx(Icon.Icon, { className: 'wallet-information-card__icon', children: icon })), jsxRuntime.jsx("div", { className: 'wallet-information-card__details', children: details }), jsxRuntime.jsx("div", { className: 'wallet-information-card__menu', children: menu })] }), network] }), jsxRuntime.jsxs("div", { className: 'wallet-information-card__balance-container', children: [jsxRuntime.jsx(Typography.Typography, { color: 'secondary', variant: 'body_small', children:
|
|
32
|
+
return (jsxRuntime.jsxs("div", { className: 'wallet-information-card', children: [jsxRuntime.jsxs("div", { className: 'wallet-information-card__header', children: [jsxRuntime.jsxs("div", { className: 'wallet-information-card__details-container', children: [icon && (jsxRuntime.jsx(Icon.Icon, { className: 'wallet-information-card__icon', children: icon })), jsxRuntime.jsx("div", { className: 'wallet-information-card__details', children: details }), jsxRuntime.jsx("div", { className: 'wallet-information-card__menu', children: menu })] }), network] }), jsxRuntime.jsxs("div", { className: 'wallet-information-card__balance-container', children: [jsxRuntime.jsx(Typography.Typography, { color: 'secondary', variant: 'body_small', copykey: 'dyn_wallet_information.balance', children: t('dyn_wallet_information.balance') }), balance] })] }));
|
|
31
33
|
};
|
|
32
34
|
|
|
33
35
|
exports.WalletInformationCard = WalletInformationCard;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { FC, ReactElement, ReactNode } from 'react';
|
|
2
|
+
import { CopyKey } from '../../shared';
|
|
2
3
|
type WalletInformationCardProps = {
|
|
3
4
|
address: string;
|
|
4
5
|
ens?: string;
|
|
@@ -6,6 +7,6 @@ type WalletInformationCardProps = {
|
|
|
6
7
|
network?: ReactNode;
|
|
7
8
|
balance?: ReactNode;
|
|
8
9
|
menu?: ReactNode;
|
|
9
|
-
};
|
|
10
|
+
} & CopyKey;
|
|
10
11
|
export declare const WalletInformationCard: FC<WalletInformationCardProps>;
|
|
11
12
|
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { useMemo } from 'react';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
3
4
|
import { Typography } from '../Typography/Typography.js';
|
|
4
5
|
import '@dynamic-labs/sdk-api';
|
|
5
6
|
import '../../shared/logger.js';
|
|
@@ -16,6 +17,7 @@ import '../../shared/consts/index.js';
|
|
|
16
17
|
import { Icon } from '../Icon/Icon.js';
|
|
17
18
|
|
|
18
19
|
const WalletInformationCard = ({ address, ens, balance, icon, network, menu, }) => {
|
|
20
|
+
const { t } = useTranslation();
|
|
19
21
|
const details = useMemo(() => {
|
|
20
22
|
const shortenAddress = shortenWalletAddress(address, 4, 4);
|
|
21
23
|
if (ens) {
|
|
@@ -23,7 +25,7 @@ const WalletInformationCard = ({ address, ens, balance, icon, network, menu, })
|
|
|
23
25
|
}
|
|
24
26
|
return (jsx(Typography, { weight: 'medium', variant: 'body_normal', color: 'primary', children: shortenAddress }));
|
|
25
27
|
}, [ens, address]);
|
|
26
|
-
return (jsxs("div", { className: 'wallet-information-card', children: [jsxs("div", { className: 'wallet-information-card__header', children: [jsxs("div", { className: 'wallet-information-card__details-container', children: [icon && (jsx(Icon, { className: 'wallet-information-card__icon', children: icon })), jsx("div", { className: 'wallet-information-card__details', children: details }), jsx("div", { className: 'wallet-information-card__menu', children: menu })] }), network] }), jsxs("div", { className: 'wallet-information-card__balance-container', children: [jsx(Typography, { color: 'secondary', variant: 'body_small', children:
|
|
28
|
+
return (jsxs("div", { className: 'wallet-information-card', children: [jsxs("div", { className: 'wallet-information-card__header', children: [jsxs("div", { className: 'wallet-information-card__details-container', children: [icon && (jsx(Icon, { className: 'wallet-information-card__icon', children: icon })), jsx("div", { className: 'wallet-information-card__details', children: details }), jsx("div", { className: 'wallet-information-card__menu', children: menu })] }), network] }), jsxs("div", { className: 'wallet-information-card__balance-container', children: [jsx(Typography, { color: 'secondary', variant: 'body_small', copykey: 'dyn_wallet_information.balance', children: t('dyn_wallet_information.balance') }), balance] })] }));
|
|
27
29
|
};
|
|
28
30
|
|
|
29
31
|
export { WalletInformationCard };
|
package/src/lib/data/api.cjs
CHANGED
|
@@ -395,6 +395,9 @@ const signInOAuth = (environmentId, providerType, { code, codeVerifier, state, c
|
|
|
395
395
|
walletPublicKey: data.payload.walletPublicKey,
|
|
396
396
|
});
|
|
397
397
|
}
|
|
398
|
+
if (data.error.code === 'email_associated_with_different_provider') {
|
|
399
|
+
throw new utils.AccountExistsError(data.error, data.payload);
|
|
400
|
+
}
|
|
398
401
|
return undefined;
|
|
399
402
|
}
|
|
400
403
|
});
|
package/src/lib/data/api.js
CHANGED
|
@@ -391,6 +391,9 @@ const signInOAuth = (environmentId, providerType, { code, codeVerifier, state, c
|
|
|
391
391
|
walletPublicKey: data.payload.walletPublicKey,
|
|
392
392
|
});
|
|
393
393
|
}
|
|
394
|
+
if (data.error.code === 'email_associated_with_different_provider') {
|
|
395
|
+
throw new AccountExistsError(data.error, data.payload);
|
|
396
|
+
}
|
|
394
397
|
return undefined;
|
|
395
398
|
}
|
|
396
399
|
});
|
|
@@ -45,6 +45,18 @@ const translation = {
|
|
|
45
45
|
description: 'You’ll need to connect both your {{firstBlockchainName}} and {{secondBlockchainName}} wallets to get started',
|
|
46
46
|
title: 'Connect to {{appName}}',
|
|
47
47
|
},
|
|
48
|
+
widget: {
|
|
49
|
+
address: 'Copy wallet address',
|
|
50
|
+
connect: 'Connect wallet',
|
|
51
|
+
connect_with_network: 'Connect {{blockchainName}} wallet',
|
|
52
|
+
copy: {
|
|
53
|
+
address: 'Copy wallet address',
|
|
54
|
+
ens: 'Copy ENS',
|
|
55
|
+
},
|
|
56
|
+
disconnect: 'Disconnect',
|
|
57
|
+
edit_profile: 'Edit profile',
|
|
58
|
+
wallet_network: '{{networkName}} wallet',
|
|
59
|
+
},
|
|
48
60
|
}
|
|
49
61
|
*/
|
|
50
62
|
dyn_bridge: {
|
|
@@ -57,6 +69,18 @@ const translation = {
|
|
|
57
69
|
description: 'You’ll need to connect both your {{firstBlockchainName}} and {{secondBlockchainName}} wallets to get started',
|
|
58
70
|
title: 'Connect to {{appName}}',
|
|
59
71
|
},
|
|
72
|
+
widget: {
|
|
73
|
+
address: 'Copy wallet address',
|
|
74
|
+
connect: 'Connect wallet',
|
|
75
|
+
connect_with_network: 'Connect {{blockchainName}} wallet',
|
|
76
|
+
copy: {
|
|
77
|
+
address: 'Copy wallet address',
|
|
78
|
+
ens: 'Copy ENS',
|
|
79
|
+
},
|
|
80
|
+
disconnect: 'Disconnect',
|
|
81
|
+
edit_profile: 'Edit profile',
|
|
82
|
+
wallet_network: '{{networkName}} wallet',
|
|
83
|
+
},
|
|
60
84
|
},
|
|
61
85
|
/**
|
|
62
86
|
* @description copy keys for Dynamic Captcha
|
|
@@ -1076,6 +1100,16 @@ const translation = {
|
|
|
1076
1100
|
empty_wallets_action_link: 'Link',
|
|
1077
1101
|
empty_wallets_action_connect: 'Connect',
|
|
1078
1102
|
},
|
|
1103
|
+
/**
|
|
1104
|
+
* @description copy keys for Dynamic wallet information card
|
|
1105
|
+
* @default
|
|
1106
|
+
* {
|
|
1107
|
+
balance: 'Balance'
|
|
1108
|
+
}
|
|
1109
|
+
*/
|
|
1110
|
+
dyn_wallet_information: {
|
|
1111
|
+
balance: 'Balance',
|
|
1112
|
+
},
|
|
1079
1113
|
};
|
|
1080
1114
|
|
|
1081
1115
|
exports.translation = translation;
|
|
@@ -40,6 +40,18 @@ export declare const translation: {
|
|
|
40
40
|
description: 'You’ll need to connect both your {{firstBlockchainName}} and {{secondBlockchainName}} wallets to get started',
|
|
41
41
|
title: 'Connect to {{appName}}',
|
|
42
42
|
},
|
|
43
|
+
widget: {
|
|
44
|
+
address: 'Copy wallet address',
|
|
45
|
+
connect: 'Connect wallet',
|
|
46
|
+
connect_with_network: 'Connect {{blockchainName}} wallet',
|
|
47
|
+
copy: {
|
|
48
|
+
address: 'Copy wallet address',
|
|
49
|
+
ens: 'Copy ENS',
|
|
50
|
+
},
|
|
51
|
+
disconnect: 'Disconnect',
|
|
52
|
+
edit_profile: 'Edit profile',
|
|
53
|
+
wallet_network: '{{networkName}} wallet',
|
|
54
|
+
},
|
|
43
55
|
}
|
|
44
56
|
*/
|
|
45
57
|
dyn_bridge: {
|
|
@@ -52,6 +64,18 @@ export declare const translation: {
|
|
|
52
64
|
description: string;
|
|
53
65
|
title: string;
|
|
54
66
|
};
|
|
67
|
+
widget: {
|
|
68
|
+
address: string;
|
|
69
|
+
connect: string;
|
|
70
|
+
connect_with_network: string;
|
|
71
|
+
copy: {
|
|
72
|
+
address: string;
|
|
73
|
+
ens: string;
|
|
74
|
+
};
|
|
75
|
+
disconnect: string;
|
|
76
|
+
edit_profile: string;
|
|
77
|
+
wallet_network: string;
|
|
78
|
+
};
|
|
55
79
|
};
|
|
56
80
|
/**
|
|
57
81
|
* @description copy keys for Dynamic Captcha
|
|
@@ -1071,4 +1095,14 @@ export declare const translation: {
|
|
|
1071
1095
|
empty_wallets_action_link: string;
|
|
1072
1096
|
empty_wallets_action_connect: string;
|
|
1073
1097
|
};
|
|
1098
|
+
/**
|
|
1099
|
+
* @description copy keys for Dynamic wallet information card
|
|
1100
|
+
* @default
|
|
1101
|
+
* {
|
|
1102
|
+
balance: 'Balance'
|
|
1103
|
+
}
|
|
1104
|
+
*/
|
|
1105
|
+
dyn_wallet_information: {
|
|
1106
|
+
balance: string;
|
|
1107
|
+
};
|
|
1074
1108
|
};
|
|
@@ -41,6 +41,18 @@ const translation = {
|
|
|
41
41
|
description: 'You’ll need to connect both your {{firstBlockchainName}} and {{secondBlockchainName}} wallets to get started',
|
|
42
42
|
title: 'Connect to {{appName}}',
|
|
43
43
|
},
|
|
44
|
+
widget: {
|
|
45
|
+
address: 'Copy wallet address',
|
|
46
|
+
connect: 'Connect wallet',
|
|
47
|
+
connect_with_network: 'Connect {{blockchainName}} wallet',
|
|
48
|
+
copy: {
|
|
49
|
+
address: 'Copy wallet address',
|
|
50
|
+
ens: 'Copy ENS',
|
|
51
|
+
},
|
|
52
|
+
disconnect: 'Disconnect',
|
|
53
|
+
edit_profile: 'Edit profile',
|
|
54
|
+
wallet_network: '{{networkName}} wallet',
|
|
55
|
+
},
|
|
44
56
|
}
|
|
45
57
|
*/
|
|
46
58
|
dyn_bridge: {
|
|
@@ -53,6 +65,18 @@ const translation = {
|
|
|
53
65
|
description: 'You’ll need to connect both your {{firstBlockchainName}} and {{secondBlockchainName}} wallets to get started',
|
|
54
66
|
title: 'Connect to {{appName}}',
|
|
55
67
|
},
|
|
68
|
+
widget: {
|
|
69
|
+
address: 'Copy wallet address',
|
|
70
|
+
connect: 'Connect wallet',
|
|
71
|
+
connect_with_network: 'Connect {{blockchainName}} wallet',
|
|
72
|
+
copy: {
|
|
73
|
+
address: 'Copy wallet address',
|
|
74
|
+
ens: 'Copy ENS',
|
|
75
|
+
},
|
|
76
|
+
disconnect: 'Disconnect',
|
|
77
|
+
edit_profile: 'Edit profile',
|
|
78
|
+
wallet_network: '{{networkName}} wallet',
|
|
79
|
+
},
|
|
56
80
|
},
|
|
57
81
|
/**
|
|
58
82
|
* @description copy keys for Dynamic Captcha
|
|
@@ -1072,6 +1096,16 @@ const translation = {
|
|
|
1072
1096
|
empty_wallets_action_link: 'Link',
|
|
1073
1097
|
empty_wallets_action_connect: 'Connect',
|
|
1074
1098
|
},
|
|
1099
|
+
/**
|
|
1100
|
+
* @description copy keys for Dynamic wallet information card
|
|
1101
|
+
* @default
|
|
1102
|
+
* {
|
|
1103
|
+
balance: 'Balance'
|
|
1104
|
+
}
|
|
1105
|
+
*/
|
|
1106
|
+
dyn_wallet_information: {
|
|
1107
|
+
balance: 'Balance',
|
|
1108
|
+
},
|
|
1075
1109
|
};
|
|
1076
1110
|
|
|
1077
1111
|
export { translation };
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
var React = require('react');
|
|
7
|
+
var reactI18next = require('react-i18next');
|
|
7
8
|
var IsBrowser = require('../../components/IsBrowser/IsBrowser.cjs');
|
|
8
9
|
require('@dynamic-labs/utils');
|
|
9
10
|
var useInternalDynamicContext = require('../../context/DynamicContext/useInternalDynamicContext.cjs');
|
|
@@ -31,7 +32,6 @@ require('react-dom');
|
|
|
31
32
|
require('../../context/ThemeContext/ThemeContext.cjs');
|
|
32
33
|
require('@dynamic-labs/types');
|
|
33
34
|
require('yup');
|
|
34
|
-
require('react-i18next');
|
|
35
35
|
require('../../context/MockContext/MockContext.cjs');
|
|
36
36
|
require('../../utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.cjs');
|
|
37
37
|
require('../../context/UserFieldEditorContext/UserFieldEditorContext.cjs');
|
|
@@ -68,6 +68,7 @@ var DynamicBridgeWidgetContext = require('./context/DynamicBridgeWidgetContext/D
|
|
|
68
68
|
const DynamicBridgeWidget = ({ className, variant = 'modal', }) => {
|
|
69
69
|
const { showAuthFlow, setShowBridgeWidget, bridgeChains, setShowAuthFlow, connectedWallets, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
70
70
|
const { widgetRef, inlineControlsRef } = DynamicBridgeWidgetContext.useDynamicBridgeWidgetContext();
|
|
71
|
+
const { t } = reactI18next.useTranslation();
|
|
71
72
|
const closeOnOutsideClick = React.useCallback((e) => {
|
|
72
73
|
var _a;
|
|
73
74
|
const target = e.composedPath().shift();
|
|
@@ -84,7 +85,7 @@ const DynamicBridgeWidget = ({ className, variant = 'modal', }) => {
|
|
|
84
85
|
if (connectedChainWallets.length > 0) {
|
|
85
86
|
return connectedChainWallets.map((wallet) => (jsxRuntime.jsx(InlineWidgetButton.InlineWidgetButton, { icon: jsxRuntime.jsx(ChainIcon, {}), onClick: () => setShowBridgeWidget(true), children: shortenWalletAddress.shortenWalletAddress(wallet.address, 3, 3) }, wallet.id)));
|
|
86
87
|
}
|
|
87
|
-
return (jsxRuntime.jsx(InlineWidgetButton.InlineWidgetButton, { icon: jsxRuntime.jsx(ChainIcon, {}), onClick: () => setShowAuthFlow(true), children:
|
|
88
|
+
return (jsxRuntime.jsx(InlineWidgetButton.InlineWidgetButton, { icon: jsxRuntime.jsx(ChainIcon, {}), onClick: () => setShowAuthFlow(true), copykey: 'dyn_bridge.widget.connect', children: t('dyn_bridge.widget.connect') }, chain));
|
|
88
89
|
}) }), jsxRuntime.jsx(DynamicBridgeUserProfile.DynamicBridgeUserProfile, { variant: variant })] }) }));
|
|
89
90
|
};
|
|
90
91
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import { useCallback } from 'react';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
3
4
|
import { IsBrowser } from '../../components/IsBrowser/IsBrowser.js';
|
|
4
5
|
import '@dynamic-labs/utils';
|
|
5
6
|
import { useInternalDynamicContext } from '../../context/DynamicContext/useInternalDynamicContext.js';
|
|
@@ -27,7 +28,6 @@ import 'react-dom';
|
|
|
27
28
|
import '../../context/ThemeContext/ThemeContext.js';
|
|
28
29
|
import '@dynamic-labs/types';
|
|
29
30
|
import 'yup';
|
|
30
|
-
import 'react-i18next';
|
|
31
31
|
import '../../context/MockContext/MockContext.js';
|
|
32
32
|
import '../../utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.js';
|
|
33
33
|
import '../../context/UserFieldEditorContext/UserFieldEditorContext.js';
|
|
@@ -64,6 +64,7 @@ import { useDynamicBridgeWidgetContext } from './context/DynamicBridgeWidgetCont
|
|
|
64
64
|
const DynamicBridgeWidget = ({ className, variant = 'modal', }) => {
|
|
65
65
|
const { showAuthFlow, setShowBridgeWidget, bridgeChains, setShowAuthFlow, connectedWallets, } = useInternalDynamicContext();
|
|
66
66
|
const { widgetRef, inlineControlsRef } = useDynamicBridgeWidgetContext();
|
|
67
|
+
const { t } = useTranslation();
|
|
67
68
|
const closeOnOutsideClick = useCallback((e) => {
|
|
68
69
|
var _a;
|
|
69
70
|
const target = e.composedPath().shift();
|
|
@@ -80,7 +81,7 @@ const DynamicBridgeWidget = ({ className, variant = 'modal', }) => {
|
|
|
80
81
|
if (connectedChainWallets.length > 0) {
|
|
81
82
|
return connectedChainWallets.map((wallet) => (jsx(InlineWidgetButton, { icon: jsx(ChainIcon, {}), onClick: () => setShowBridgeWidget(true), children: shortenWalletAddress(wallet.address, 3, 3) }, wallet.id)));
|
|
82
83
|
}
|
|
83
|
-
return (jsx(InlineWidgetButton, { icon: jsx(ChainIcon, {}), onClick: () => setShowAuthFlow(true), children:
|
|
84
|
+
return (jsx(InlineWidgetButton, { icon: jsx(ChainIcon, {}), onClick: () => setShowAuthFlow(true), copykey: 'dyn_bridge.widget.connect', children: t('dyn_bridge.widget.connect') }, chain));
|
|
84
85
|
}) }), jsx(DynamicBridgeUserProfile, { variant: variant })] }) }));
|
|
85
86
|
};
|
|
86
87
|
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
var React = require('react');
|
|
7
|
+
var reactI18next = require('react-i18next');
|
|
7
8
|
var classNames = require('../../../../utils/functions/classNames/classNames.cjs');
|
|
8
9
|
require('@dynamic-labs/utils');
|
|
9
10
|
require('../../../../context/DynamicContext/DynamicContext.cjs');
|
|
@@ -28,7 +29,6 @@ require('react-dom');
|
|
|
28
29
|
require('../../../../context/ThemeContext/ThemeContext.cjs');
|
|
29
30
|
require('@dynamic-labs/types');
|
|
30
31
|
require('yup');
|
|
31
|
-
require('react-i18next');
|
|
32
32
|
require('../../../../context/MockContext/MockContext.cjs');
|
|
33
33
|
require('../../../../utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.cjs');
|
|
34
34
|
require('../../../../context/UserFieldEditorContext/UserFieldEditorContext.cjs');
|
|
@@ -64,9 +64,14 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
64
64
|
|
|
65
65
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
66
66
|
|
|
67
|
-
const DynamicBridgeWalletCard = ({ className, networkIcon, networkName, children }) =>
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
67
|
+
const DynamicBridgeWalletCard = ({ className, networkIcon, networkName, children }) => {
|
|
68
|
+
const { t } = reactI18next.useTranslation();
|
|
69
|
+
return (jsxRuntime.jsxs("div", { className: classNames.classNames('dynamic-bridge-wallet-card', className), children: [jsxRuntime.jsxs("div", { className: 'dynamic-bridge-wallet-card__network', children: [networkIcon &&
|
|
70
|
+
React__default["default"].cloneElement(networkIcon, {
|
|
71
|
+
className: 'dynamic-bridge-wallet-card__network-icon',
|
|
72
|
+
}), networkName && (jsxRuntime.jsx(Typography.Typography, { className: 'dynamic-bridge-wallet-card__network-name', variant: 'body_small', color: 'primary', weight: 'medium', as: 'span', copykey: 'dyn_bridge.widget.wallet_network', children: t('dyn_bridge.widget.wallet_network', {
|
|
73
|
+
networkName,
|
|
74
|
+
}) }))] }), children] }));
|
|
75
|
+
};
|
|
71
76
|
|
|
72
77
|
exports.DynamicBridgeWalletCard = DynamicBridgeWalletCard;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { jsxs } from 'react/jsx-runtime';
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import React__default from 'react';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
3
4
|
import { classNames } from '../../../../utils/functions/classNames/classNames.js';
|
|
4
5
|
import '@dynamic-labs/utils';
|
|
5
6
|
import '../../../../context/DynamicContext/DynamicContext.js';
|
|
@@ -24,7 +25,6 @@ import 'react-dom';
|
|
|
24
25
|
import '../../../../context/ThemeContext/ThemeContext.js';
|
|
25
26
|
import '@dynamic-labs/types';
|
|
26
27
|
import 'yup';
|
|
27
|
-
import 'react-i18next';
|
|
28
28
|
import '../../../../context/MockContext/MockContext.js';
|
|
29
29
|
import '../../../../utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.js';
|
|
30
30
|
import '../../../../context/UserFieldEditorContext/UserFieldEditorContext.js';
|
|
@@ -56,9 +56,14 @@ import '../../../../components/Popper/Popper/Popper.js';
|
|
|
56
56
|
import '../../../../components/Popper/PopperContext/PopperContext.js';
|
|
57
57
|
import 'react-focus-lock';
|
|
58
58
|
|
|
59
|
-
const DynamicBridgeWalletCard = ({ className, networkIcon, networkName, children }) =>
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
59
|
+
const DynamicBridgeWalletCard = ({ className, networkIcon, networkName, children }) => {
|
|
60
|
+
const { t } = useTranslation();
|
|
61
|
+
return (jsxs("div", { className: classNames('dynamic-bridge-wallet-card', className), children: [jsxs("div", { className: 'dynamic-bridge-wallet-card__network', children: [networkIcon &&
|
|
62
|
+
React__default.cloneElement(networkIcon, {
|
|
63
|
+
className: 'dynamic-bridge-wallet-card__network-icon',
|
|
64
|
+
}), networkName && (jsx(Typography, { className: 'dynamic-bridge-wallet-card__network-name', variant: 'body_small', color: 'primary', weight: 'medium', as: 'span', copykey: 'dyn_bridge.widget.wallet_network', children: t('dyn_bridge.widget.wallet_network', {
|
|
65
|
+
networkName,
|
|
66
|
+
}) }))] }), children] }));
|
|
67
|
+
};
|
|
63
68
|
|
|
64
69
|
export { DynamicBridgeWalletCard };
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
var reactI18next = require('react-i18next');
|
|
6
7
|
var walletBook = require('@dynamic-labs/wallet-book');
|
|
7
8
|
require('react');
|
|
8
9
|
require('@dynamic-labs/utils');
|
|
@@ -27,7 +28,6 @@ require('react-dom');
|
|
|
27
28
|
require('../../../../context/ThemeContext/ThemeContext.cjs');
|
|
28
29
|
require('@dynamic-labs/types');
|
|
29
30
|
require('yup');
|
|
30
|
-
require('react-i18next');
|
|
31
31
|
require('../../../../context/MockContext/MockContext.cjs');
|
|
32
32
|
require('../../../../utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.cjs');
|
|
33
33
|
require('../../../../context/UserFieldEditorContext/UserFieldEditorContext.cjs');
|
|
@@ -62,28 +62,29 @@ var WalletInformationCard = require('../../../../components/WalletInformationCar
|
|
|
62
62
|
var useFetchNameService = require('../../../DynamicWidget/hooks/useFetchNameService/useFetchNameService.cjs');
|
|
63
63
|
|
|
64
64
|
const DynamicBridgeWalletCardBody = ({ walletAddress, walletBalance, walletKey, onDisconnectClick }) => {
|
|
65
|
+
const { t } = reactI18next.useTranslation();
|
|
65
66
|
const nameService = useFetchNameService.useFetchNameService(walletAddress);
|
|
66
67
|
const options = [
|
|
67
68
|
{
|
|
68
69
|
Icon: null,
|
|
69
70
|
callback: () => (nameService === null || nameService === void 0 ? void 0 : nameService.name) && navigator.clipboard.writeText(nameService === null || nameService === void 0 ? void 0 : nameService.name),
|
|
70
71
|
hide: !(nameService === null || nameService === void 0 ? void 0 : nameService.name),
|
|
71
|
-
text: '
|
|
72
|
+
text: t('dyn_bridge.widget.copy.ens'),
|
|
72
73
|
},
|
|
73
74
|
{
|
|
74
75
|
Icon: null,
|
|
75
76
|
callback: () => walletAddress && navigator.clipboard.writeText(walletAddress),
|
|
76
77
|
hide: !walletAddress,
|
|
77
|
-
text: '
|
|
78
|
+
text: t('dyn_bridge.widget.copy.address'),
|
|
78
79
|
},
|
|
79
80
|
{
|
|
80
81
|
Icon: null,
|
|
81
82
|
callback: () => onDisconnectClick === null || onDisconnectClick === void 0 ? void 0 : onDisconnectClick(),
|
|
82
83
|
hide: !onDisconnectClick,
|
|
83
|
-
text: '
|
|
84
|
+
text: t('dyn_bridge.widget.disconnect'),
|
|
84
85
|
},
|
|
85
86
|
];
|
|
86
|
-
return (jsxRuntime.jsx(WalletInformationCard.WalletInformationCard, { ens: nameService === null || nameService === void 0 ? void 0 : nameService.name, address: walletAddress, icon: jsxRuntime.jsx(walletBook.WalletIcon, { walletKey: walletKey }), balance: walletBalance, menu: jsxRuntime.jsx(DotsMenu.DotsMenu, { options: options }) }));
|
|
87
|
+
return (jsxRuntime.jsx(WalletInformationCard.WalletInformationCard, { ens: nameService === null || nameService === void 0 ? void 0 : nameService.name, address: walletAddress, icon: jsxRuntime.jsx(walletBook.WalletIcon, { walletKey: walletKey }), balance: walletBalance, menu: jsxRuntime.jsx(DotsMenu.DotsMenu, { options: options }), copykey: 'dyn_bridge.widget' }));
|
|
87
88
|
};
|
|
88
89
|
|
|
89
90
|
exports.DynamicBridgeWalletCardBody = DynamicBridgeWalletCardBody;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useTranslation } from 'react-i18next';
|
|
2
3
|
import { WalletIcon } from '@dynamic-labs/wallet-book';
|
|
3
4
|
import 'react';
|
|
4
5
|
import '@dynamic-labs/utils';
|
|
@@ -23,7 +24,6 @@ import 'react-dom';
|
|
|
23
24
|
import '../../../../context/ThemeContext/ThemeContext.js';
|
|
24
25
|
import '@dynamic-labs/types';
|
|
25
26
|
import 'yup';
|
|
26
|
-
import 'react-i18next';
|
|
27
27
|
import '../../../../context/MockContext/MockContext.js';
|
|
28
28
|
import '../../../../utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.js';
|
|
29
29
|
import '../../../../context/UserFieldEditorContext/UserFieldEditorContext.js';
|
|
@@ -58,28 +58,29 @@ import { WalletInformationCard } from '../../../../components/WalletInformationC
|
|
|
58
58
|
import { useFetchNameService } from '../../../DynamicWidget/hooks/useFetchNameService/useFetchNameService.js';
|
|
59
59
|
|
|
60
60
|
const DynamicBridgeWalletCardBody = ({ walletAddress, walletBalance, walletKey, onDisconnectClick }) => {
|
|
61
|
+
const { t } = useTranslation();
|
|
61
62
|
const nameService = useFetchNameService(walletAddress);
|
|
62
63
|
const options = [
|
|
63
64
|
{
|
|
64
65
|
Icon: null,
|
|
65
66
|
callback: () => (nameService === null || nameService === void 0 ? void 0 : nameService.name) && navigator.clipboard.writeText(nameService === null || nameService === void 0 ? void 0 : nameService.name),
|
|
66
67
|
hide: !(nameService === null || nameService === void 0 ? void 0 : nameService.name),
|
|
67
|
-
text: '
|
|
68
|
+
text: t('dyn_bridge.widget.copy.ens'),
|
|
68
69
|
},
|
|
69
70
|
{
|
|
70
71
|
Icon: null,
|
|
71
72
|
callback: () => walletAddress && navigator.clipboard.writeText(walletAddress),
|
|
72
73
|
hide: !walletAddress,
|
|
73
|
-
text: '
|
|
74
|
+
text: t('dyn_bridge.widget.copy.address'),
|
|
74
75
|
},
|
|
75
76
|
{
|
|
76
77
|
Icon: null,
|
|
77
78
|
callback: () => onDisconnectClick === null || onDisconnectClick === void 0 ? void 0 : onDisconnectClick(),
|
|
78
79
|
hide: !onDisconnectClick,
|
|
79
|
-
text: '
|
|
80
|
+
text: t('dyn_bridge.widget.disconnect'),
|
|
80
81
|
},
|
|
81
82
|
];
|
|
82
|
-
return (jsx(WalletInformationCard, { ens: nameService === null || nameService === void 0 ? void 0 : nameService.name, address: walletAddress, icon: jsx(WalletIcon, { walletKey: walletKey }), balance: walletBalance, menu: jsx(DotsMenu, { options: options }) }));
|
|
83
|
+
return (jsx(WalletInformationCard, { ens: nameService === null || nameService === void 0 ? void 0 : nameService.name, address: walletAddress, icon: jsx(WalletIcon, { walletKey: walletKey }), balance: walletBalance, menu: jsx(DotsMenu, { options: options }), copykey: 'dyn_bridge.widget' }));
|
|
83
84
|
};
|
|
84
85
|
|
|
85
86
|
export { DynamicBridgeWalletCardBody };
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
var reactI18next = require('react-i18next');
|
|
6
7
|
var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
|
|
7
8
|
var useInternalDynamicContext = require('../../../../context/DynamicContext/useInternalDynamicContext.cjs');
|
|
8
9
|
require('@dynamic-labs/sdk-api');
|
|
@@ -28,7 +29,6 @@ require('react-dom');
|
|
|
28
29
|
require('../../../../context/ThemeContext/ThemeContext.cjs');
|
|
29
30
|
require('@dynamic-labs/types');
|
|
30
31
|
require('yup');
|
|
31
|
-
require('react-i18next');
|
|
32
32
|
require('../../../../context/MockContext/MockContext.cjs');
|
|
33
33
|
require('../../../../utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.cjs');
|
|
34
34
|
require('../../../../context/UserFieldEditorContext/UserFieldEditorContext.cjs');
|
|
@@ -61,6 +61,7 @@ require('../../../../components/Popper/PopperContext/PopperContext.cjs');
|
|
|
61
61
|
require('react-focus-lock');
|
|
62
62
|
|
|
63
63
|
const DynamicBridgeWidgetEmptyCard = ({ chain }) => {
|
|
64
|
+
const { t } = reactI18next.useTranslation();
|
|
64
65
|
const { bridgeChainsToConnect, setShowAuthFlow, setShowBridgeWidget } = useInternalDynamicContext.useInternalDynamicContext();
|
|
65
66
|
if (!(bridgeChainsToConnect === null || bridgeChainsToConnect === void 0 ? void 0 : bridgeChainsToConnect.length) || !chain) {
|
|
66
67
|
return null;
|
|
@@ -70,7 +71,9 @@ const DynamicBridgeWidgetEmptyCard = ({ chain }) => {
|
|
|
70
71
|
return (jsxRuntime.jsxs("div", { role: 'button', className: 'dynamic-bridge-widget-empty-card', onClick: () => {
|
|
71
72
|
setShowBridgeWidget(false);
|
|
72
73
|
setShowAuthFlow(true);
|
|
73
|
-
}, children: [jsxRuntime.jsx(ChainIcon, { className: 'dynamic-bridge-widget-empty-card__icon' }), jsxRuntime.
|
|
74
|
+
}, children: [jsxRuntime.jsx(ChainIcon, { className: 'dynamic-bridge-widget-empty-card__icon' }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'medium', as: 'span', color: 'primary', className: 'dynamic-bridge-widget-empty-card__text', copykey: 'dyn_bridge.widget.connect_with_network', children: t('dyn_bridge.widget.connect_with_network', {
|
|
75
|
+
blockchainName: chainInfo === null || chainInfo === void 0 ? void 0 : chainInfo.blockchainName,
|
|
76
|
+
}) })] }));
|
|
74
77
|
};
|
|
75
78
|
|
|
76
79
|
exports.DynamicBridgeWidgetEmptyCard = DynamicBridgeWidgetEmptyCard;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useTranslation } from 'react-i18next';
|
|
2
3
|
import { getChainInfo } from '@dynamic-labs/wallet-connector-core';
|
|
3
4
|
import { useInternalDynamicContext } from '../../../../context/DynamicContext/useInternalDynamicContext.js';
|
|
4
5
|
import '@dynamic-labs/sdk-api';
|
|
@@ -24,7 +25,6 @@ import 'react-dom';
|
|
|
24
25
|
import '../../../../context/ThemeContext/ThemeContext.js';
|
|
25
26
|
import '@dynamic-labs/types';
|
|
26
27
|
import 'yup';
|
|
27
|
-
import 'react-i18next';
|
|
28
28
|
import '../../../../context/MockContext/MockContext.js';
|
|
29
29
|
import '../../../../utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.js';
|
|
30
30
|
import '../../../../context/UserFieldEditorContext/UserFieldEditorContext.js';
|
|
@@ -57,6 +57,7 @@ import '../../../../components/Popper/PopperContext/PopperContext.js';
|
|
|
57
57
|
import 'react-focus-lock';
|
|
58
58
|
|
|
59
59
|
const DynamicBridgeWidgetEmptyCard = ({ chain }) => {
|
|
60
|
+
const { t } = useTranslation();
|
|
60
61
|
const { bridgeChainsToConnect, setShowAuthFlow, setShowBridgeWidget } = useInternalDynamicContext();
|
|
61
62
|
if (!(bridgeChainsToConnect === null || bridgeChainsToConnect === void 0 ? void 0 : bridgeChainsToConnect.length) || !chain) {
|
|
62
63
|
return null;
|
|
@@ -66,7 +67,9 @@ const DynamicBridgeWidgetEmptyCard = ({ chain }) => {
|
|
|
66
67
|
return (jsxs("div", { role: 'button', className: 'dynamic-bridge-widget-empty-card', onClick: () => {
|
|
67
68
|
setShowBridgeWidget(false);
|
|
68
69
|
setShowAuthFlow(true);
|
|
69
|
-
}, children: [jsx(ChainIcon, { className: 'dynamic-bridge-widget-empty-card__icon' }),
|
|
70
|
+
}, children: [jsx(ChainIcon, { className: 'dynamic-bridge-widget-empty-card__icon' }), jsx(Typography, { variant: 'body_normal', weight: 'medium', as: 'span', color: 'primary', className: 'dynamic-bridge-widget-empty-card__text', copykey: 'dyn_bridge.widget.connect_with_network', children: t('dyn_bridge.widget.connect_with_network', {
|
|
71
|
+
blockchainName: chainInfo === null || chainInfo === void 0 ? void 0 : chainInfo.blockchainName,
|
|
72
|
+
}) })] }));
|
|
70
73
|
};
|
|
71
74
|
|
|
72
75
|
export { DynamicBridgeWidgetEmptyCard };
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
var reactI18next = require('react-i18next');
|
|
6
7
|
var UserProfile = require('../../../../components/UserProfile/UserProfile.cjs');
|
|
7
8
|
var DynamicWidgetFooter = require('../../../DynamicWidget/components/DynamicWidgetFooter/DynamicWidgetFooter.cjs');
|
|
8
9
|
var DynamicBridgeWidgetContext = require('../../context/DynamicBridgeWidgetContext/DynamicBridgeWidgetContext.cjs');
|
|
@@ -17,6 +18,7 @@ var useInternalDynamicContext = require('../../../../context/DynamicContext/useI
|
|
|
17
18
|
var getUserProfileFields = require('../../../../utils/functions/getUserProfileFields/getUserProfileFields.cjs');
|
|
18
19
|
|
|
19
20
|
const ProfileView = () => {
|
|
21
|
+
const { t } = reactI18next.useTranslation();
|
|
20
22
|
const { setBridgeWidgetView } = DynamicBridgeWidgetContext.useDynamicBridgeWidgetContext();
|
|
21
23
|
const { projectSettings } = useInternalDynamicContext.useInternalDynamicContext();
|
|
22
24
|
// Allow to navigate to edit profile view when there are fields what can be edited
|
|
@@ -24,7 +26,7 @@ const ProfileView = () => {
|
|
|
24
26
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(UserProfile.UserProfile, { rootClassName: 'profile-view' }), jsxRuntime.jsx(DynamicWidgetFooter.DynamicWidgetFooter, { children: jsxRuntime.jsxs("div", { className: 'profile-view__footer', children: [editableUserFields.length > 0 && (jsxRuntime.jsx(Button.Button, { buttonClassName: 'dynamic-widget-footer__button', buttonVariant: 'tertiary', buttonPadding: 'none', typographyProps: {
|
|
25
27
|
color: 'secondary',
|
|
26
28
|
variant: 'button_tertiary',
|
|
27
|
-
}, onClick: () => setBridgeWidgetView('edit-profile'), startSlot: jsxRuntime.jsx(pencil.ReactComponent, {}), children:
|
|
29
|
+
}, onClick: () => setBridgeWidgetView('edit-profile'), startSlot: jsxRuntime.jsx(pencil.ReactComponent, {}), copykey: 'dyn_bridge.widget.edit_profile', children: t('dyn_bridge.widget.edit_profile') })), jsxRuntime.jsx(LogoutButton.LogoutButton, { isTextButton: true, buttonClassName: classNames.classNames('dynamic-widget-footer__button', {
|
|
28
30
|
'dynamic-widget-footer__button-align-right': !(editableUserFields === null || editableUserFields === void 0 ? void 0 : editableUserFields.length),
|
|
29
31
|
}) })] }) })] }));
|
|
30
32
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useTranslation } from 'react-i18next';
|
|
2
3
|
import { UserProfile } from '../../../../components/UserProfile/UserProfile.js';
|
|
3
4
|
import { DynamicWidgetFooter } from '../../../DynamicWidget/components/DynamicWidgetFooter/DynamicWidgetFooter.js';
|
|
4
5
|
import { useDynamicBridgeWidgetContext } from '../../context/DynamicBridgeWidgetContext/DynamicBridgeWidgetContext.js';
|
|
@@ -13,6 +14,7 @@ import { useInternalDynamicContext } from '../../../../context/DynamicContext/us
|
|
|
13
14
|
import { getEditableUserProfileFields } from '../../../../utils/functions/getUserProfileFields/getUserProfileFields.js';
|
|
14
15
|
|
|
15
16
|
const ProfileView = () => {
|
|
17
|
+
const { t } = useTranslation();
|
|
16
18
|
const { setBridgeWidgetView } = useDynamicBridgeWidgetContext();
|
|
17
19
|
const { projectSettings } = useInternalDynamicContext();
|
|
18
20
|
// Allow to navigate to edit profile view when there are fields what can be edited
|
|
@@ -20,7 +22,7 @@ const ProfileView = () => {
|
|
|
20
22
|
return (jsxs(Fragment, { children: [jsx(UserProfile, { rootClassName: 'profile-view' }), jsx(DynamicWidgetFooter, { children: jsxs("div", { className: 'profile-view__footer', children: [editableUserFields.length > 0 && (jsx(Button, { buttonClassName: 'dynamic-widget-footer__button', buttonVariant: 'tertiary', buttonPadding: 'none', typographyProps: {
|
|
21
23
|
color: 'secondary',
|
|
22
24
|
variant: 'button_tertiary',
|
|
23
|
-
}, onClick: () => setBridgeWidgetView('edit-profile'), startSlot: jsx(SvgPencil, {}), children:
|
|
25
|
+
}, onClick: () => setBridgeWidgetView('edit-profile'), startSlot: jsx(SvgPencil, {}), copykey: 'dyn_bridge.widget.edit_profile', children: t('dyn_bridge.widget.edit_profile') })), jsx(LogoutButton, { isTextButton: true, buttonClassName: classNames('dynamic-widget-footer__button', {
|
|
24
26
|
'dynamic-widget-footer__button-align-right': !(editableUserFields === null || editableUserFields === void 0 ? void 0 : editableUserFields.length),
|
|
25
27
|
}) })] }) })] }));
|
|
26
28
|
};
|