@dynamic-labs/sdk-react-core 1.1.0-alpha.1 → 1.1.0-alpha.2
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 +7 -0
- package/package.cjs +2 -2
- package/package.js +2 -2
- package/package.json +11 -11
- package/src/lib/components/CopyButton/CopyButton.d.ts +2 -1
- package/src/lib/locale/en/translation.cjs +118 -1
- package/src/lib/locale/en/translation.d.ts +118 -1
- package/src/lib/locale/en/translation.js +118 -1
- package/src/lib/shared/utils/functions/chain/getChainIcon.cjs +1 -0
- package/src/lib/shared/utils/functions/chain/getChainIcon.js +2 -1
- package/src/lib/views/CaptchaVerifyUser/CaptchaVerifyUser.cjs +3 -2
- package/src/lib/views/CaptchaVerifyUser/CaptchaVerifyUser.js +3 -2
- package/src/lib/views/CollectUserDataView/UserDataFields/index.cjs +3 -2
- package/src/lib/views/CollectUserDataView/UserDataFields/index.js +3 -2
- package/src/lib/views/MergeUserAccountsView/MergeUserAccountsView.cjs +1 -1
- package/src/lib/views/MergeUserAccountsView/MergeUserAccountsView.js +1 -1
- package/src/lib/views/NoQrNotInstalledView/NoQrNotInstalledView.cjs +6 -2
- package/src/lib/views/NoQrNotInstalledView/NoQrNotInstalledView.js +6 -2
- package/src/lib/views/NoQrNotInstalledView/WalletHelpLink.cjs +10 -5
- package/src/lib/views/NoQrNotInstalledView/WalletHelpLink.js +10 -5
- package/src/lib/views/PendingConnectView/PendingConnectView.cjs +7 -4
- package/src/lib/views/PendingConnectView/PendingConnectView.js +7 -4
- package/src/lib/views/PendingSignatureView/PendingSignatureView.cjs +8 -5
- package/src/lib/views/PendingSignatureView/PendingSignatureView.js +8 -5
- package/src/lib/views/QrCodeView/QrCodeContainer/QrCodeContainer.cjs +11 -8
- package/src/lib/views/QrCodeView/QrCodeContainer/QrCodeContainer.js +11 -8
- package/src/lib/views/SocialWrongAccountView/SocialWrongAccountView.cjs +4 -3
- package/src/lib/views/SocialWrongAccountView/SocialWrongAccountView.js +4 -3
- package/src/lib/views/WalletLockedView/WalletLockedView.cjs +3 -2
- package/src/lib/views/WalletLockedView/WalletLockedView.js +3 -2
- package/src/lib/views/WalletSignSpinnerView/WalletSignSpinnerView.cjs +4 -3
- package/src/lib/views/WalletSignSpinnerView/WalletSignSpinnerView.js +4 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AlgorandIcon, CosmosIcon, EthereumIcon, FlowIcon, SolanaIcon, StarknetIcon } from '@dynamic-labs/iconic';
|
|
1
|
+
import { AlgorandIcon, BitcoinIcon, CosmosIcon, EthereumIcon, FlowIcon, SolanaIcon, StarknetIcon } from '@dynamic-labs/iconic';
|
|
2
2
|
import { getChainInfo } from '@dynamic-labs/wallet-connector-core';
|
|
3
3
|
import 'react/jsx-runtime';
|
|
4
4
|
import '../../../../context/ViewContext/ViewContext.js';
|
|
@@ -7,6 +7,7 @@ import { ReactComponent as SvgError } from '../../../assets/error.js';
|
|
|
7
7
|
|
|
8
8
|
const chainIconMap = {
|
|
9
9
|
algorand: AlgorandIcon,
|
|
10
|
+
bitcoin: BitcoinIcon,
|
|
10
11
|
cosmos: CosmosIcon,
|
|
11
12
|
evm: EthereumIcon,
|
|
12
13
|
flow: FlowIcon,
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var _tslib = require('../../../../_virtual/_tslib.cjs');
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
+
var reactI18next = require('react-i18next');
|
|
7
8
|
var iconic = require('@dynamic-labs/iconic');
|
|
8
9
|
require('react');
|
|
9
10
|
require('../../events/dynamicEvents.cjs');
|
|
@@ -29,7 +30,6 @@ require('react-dom');
|
|
|
29
30
|
require('../../context/ThemeContext/ThemeContext.cjs');
|
|
30
31
|
require('@dynamic-labs/types');
|
|
31
32
|
require('yup');
|
|
32
|
-
require('react-i18next');
|
|
33
33
|
require('../../context/MockContext/MockContext.cjs');
|
|
34
34
|
require('../../utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.cjs');
|
|
35
35
|
require('../../context/UserFieldEditorContext/UserFieldEditorContext.cjs');
|
|
@@ -64,12 +64,13 @@ require('react-focus-lock');
|
|
|
64
64
|
var Captcha = require('../../components/Captcha/Captcha.cjs');
|
|
65
65
|
|
|
66
66
|
const CaptchaVerifyUser = () => {
|
|
67
|
+
const { t } = reactI18next.useTranslation();
|
|
67
68
|
const { captchaAuthState } = CaptchaContext.useCaptchaContext();
|
|
68
69
|
const handleSuccess = (captchaToken) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
69
70
|
var _a;
|
|
70
71
|
yield ((_a = captchaAuthState === null || captchaAuthState === void 0 ? void 0 : captchaAuthState.onCaptchaSuccess) === null || _a === void 0 ? void 0 : _a.call(captchaAuthState, captchaToken));
|
|
71
72
|
});
|
|
72
|
-
return (jsxRuntime.jsxs("div", { className: 'captcha-verify-user__container', children: [jsxRuntime.jsx(iconic.CaptchaWaveIcon, { className: 'captcha-verify-user__icon' }), jsxRuntime.jsx(Typography.Typography, { weight: 'medium', variant: 'title', color: 'primary', className: 'captcha-verify-user__title',
|
|
73
|
+
return (jsxRuntime.jsxs("div", { className: 'captcha-verify-user__container', children: [jsxRuntime.jsx(iconic.CaptchaWaveIcon, { className: 'captcha-verify-user__icon' }), jsxRuntime.jsx(Typography.Typography, { weight: 'medium', variant: 'title', color: 'primary', className: 'captcha-verify-user__title', copykey: 'dyn_captcha.verify_user_title', children: t('dyn_captcha.verify_user_title') }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', className: 'captcha-verify-user__subtitle', copykey: 'dyn_captcha.verify_user_subtitle', children: t('dyn_captcha.verify_user_subtitle') }), jsxRuntime.jsx(Captcha.Captcha, { handleSuccess: handleSuccess }), jsxRuntime.jsx(PoweredByDynamic.PoweredByDynamic, { classNameRoot: 'captcha-verify-user__dynamic-logo' })] }));
|
|
73
74
|
};
|
|
74
75
|
|
|
75
76
|
exports.CaptchaVerifyUser = CaptchaVerifyUser;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { __awaiter } from '../../../../_virtual/_tslib.js';
|
|
2
2
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
3
4
|
import { CaptchaWaveIcon } from '@dynamic-labs/iconic';
|
|
4
5
|
import 'react';
|
|
5
6
|
import '../../events/dynamicEvents.js';
|
|
@@ -25,7 +26,6 @@ import 'react-dom';
|
|
|
25
26
|
import '../../context/ThemeContext/ThemeContext.js';
|
|
26
27
|
import '@dynamic-labs/types';
|
|
27
28
|
import 'yup';
|
|
28
|
-
import 'react-i18next';
|
|
29
29
|
import '../../context/MockContext/MockContext.js';
|
|
30
30
|
import '../../utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.js';
|
|
31
31
|
import '../../context/UserFieldEditorContext/UserFieldEditorContext.js';
|
|
@@ -60,12 +60,13 @@ import 'react-focus-lock';
|
|
|
60
60
|
import { Captcha } from '../../components/Captcha/Captcha.js';
|
|
61
61
|
|
|
62
62
|
const CaptchaVerifyUser = () => {
|
|
63
|
+
const { t } = useTranslation();
|
|
63
64
|
const { captchaAuthState } = useCaptchaContext();
|
|
64
65
|
const handleSuccess = (captchaToken) => __awaiter(void 0, void 0, void 0, function* () {
|
|
65
66
|
var _a;
|
|
66
67
|
yield ((_a = captchaAuthState === null || captchaAuthState === void 0 ? void 0 : captchaAuthState.onCaptchaSuccess) === null || _a === void 0 ? void 0 : _a.call(captchaAuthState, captchaToken));
|
|
67
68
|
});
|
|
68
|
-
return (jsxs("div", { className: 'captcha-verify-user__container', children: [jsx(CaptchaWaveIcon, { className: 'captcha-verify-user__icon' }), jsx(Typography, { weight: 'medium', variant: 'title', color: 'primary', className: 'captcha-verify-user__title',
|
|
69
|
+
return (jsxs("div", { className: 'captcha-verify-user__container', children: [jsx(CaptchaWaveIcon, { className: 'captcha-verify-user__icon' }), jsx(Typography, { weight: 'medium', variant: 'title', color: 'primary', className: 'captcha-verify-user__title', copykey: 'dyn_captcha.verify_user_title', children: t('dyn_captcha.verify_user_title') }), jsx(Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', className: 'captcha-verify-user__subtitle', copykey: 'dyn_captcha.verify_user_subtitle', children: t('dyn_captcha.verify_user_subtitle') }), jsx(Captcha, { handleSuccess: handleSuccess }), jsx(PoweredByDynamic, { classNameRoot: 'captcha-verify-user__dynamic-logo' })] }));
|
|
69
70
|
};
|
|
70
71
|
|
|
71
72
|
export { CaptchaVerifyUser };
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
var formik = require('formik');
|
|
7
|
+
var reactI18next = require('react-i18next');
|
|
7
8
|
require('react');
|
|
8
9
|
require('../../../events/dynamicEvents.cjs');
|
|
9
10
|
require('@dynamic-labs/utils');
|
|
@@ -36,7 +37,6 @@ require('../../../utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.c
|
|
|
36
37
|
require('../../../context/UserFieldEditorContext/UserFieldEditorContext.cjs');
|
|
37
38
|
require('@dynamic-labs/rpc-providers');
|
|
38
39
|
require('../../../context/UserWalletsContext/UserWalletsContext.cjs');
|
|
39
|
-
require('react-i18next');
|
|
40
40
|
require('../../../components/Transition/ZoomTransition/ZoomTransition.cjs');
|
|
41
41
|
require('../../../components/Transition/SlideInUpTransition/SlideInUpTransition.cjs');
|
|
42
42
|
require('../../../components/Transition/OpacityTransition/OpacityTransition.cjs');
|
|
@@ -69,6 +69,7 @@ var Select = require('../../../components/Select/Select.cjs');
|
|
|
69
69
|
|
|
70
70
|
const UserDataFields = ({ errors, policiesConsentInnerComponentArray, fields, touched, }) => {
|
|
71
71
|
const { fieldsConfig } = useFields.useFields();
|
|
72
|
+
const { t } = reactI18next.useTranslation();
|
|
72
73
|
return (jsxRuntime.jsx("div", { className: 'user-data-fields__fields-column', children: fields === null || fields === void 0 ? void 0 : fields.map(({ name, required, enabled }) => {
|
|
73
74
|
const { label, type, key } = index.getValueByKey(fieldsConfig, name);
|
|
74
75
|
if (name === 'tShirtSize') {
|
|
@@ -84,7 +85,7 @@ const UserDataFields = ({ errors, policiesConsentInnerComponentArray, fields, to
|
|
|
84
85
|
return (jsxRuntime.jsx("div", { role: 'group', "aria-labelledby": 'checkbox-group', className: 'user-data-fields__checkbox-container', children: policiesConsentInnerComponentArray === null || policiesConsentInnerComponentArray === void 0 ? void 0 : policiesConsentInnerComponentArray.map((component, index) => (jsxRuntime.jsxs("div", { className: 'user-data-fields__consent-checkbox', children: [jsxRuntime.jsx(formik.Field, { copykey: key, as: Checkbox.Checkbox, id: `policiesConsent_${index}`, name: 'policiesConsentArray', type: 'checkbox', value: `${index}` }, `policiesConsent_${index}`), jsxRuntime.jsx("label", { htmlFor: `policiesConsent_${index}`, className: 'user-data-fields__checkbox-label', children: jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', color: 'secondary', children: component }) })] }, `policiesConsent_${index}`))) }, 'policiesConsentGroup'));
|
|
85
86
|
}
|
|
86
87
|
else if (name === 'email' && !enabled) {
|
|
87
|
-
return (jsxRuntime.jsx(Tooltip.Tooltip, { content: '
|
|
88
|
+
return (jsxRuntime.jsx(Tooltip.Tooltip, { content: t('dyn_collect_user_data.update_email_tooltip'), className: 'user-data-fields__tooltip', copykey: 'dyn_collect_user_data.update_email_tooltip', children: jsxRuntime.jsx(formik.Field, { copykey: key, disabled: true, as: Input.Input, type: type, id: name, name: name, label: label }, name) }, 'disabled-email-tooltip'));
|
|
88
89
|
}
|
|
89
90
|
else {
|
|
90
91
|
return (jsxRuntime.jsx(formik.Field, { copykey: key, disabled: !enabled, as: Input.Input, type: type, id: name, name: name, label: label, optional: enabled && !required, error: errors[name] && touched[name], message: touched[name] && getDisplayErrorMessage.getDisplayErrorMessage(label, errors[name]) }, name));
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import { Field } from 'formik';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
3
4
|
import 'react';
|
|
4
5
|
import '../../../events/dynamicEvents.js';
|
|
5
6
|
import '@dynamic-labs/utils';
|
|
@@ -32,7 +33,6 @@ import '../../../utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.js
|
|
|
32
33
|
import '../../../context/UserFieldEditorContext/UserFieldEditorContext.js';
|
|
33
34
|
import '@dynamic-labs/rpc-providers';
|
|
34
35
|
import '../../../context/UserWalletsContext/UserWalletsContext.js';
|
|
35
|
-
import 'react-i18next';
|
|
36
36
|
import '../../../components/Transition/ZoomTransition/ZoomTransition.js';
|
|
37
37
|
import '../../../components/Transition/SlideInUpTransition/SlideInUpTransition.js';
|
|
38
38
|
import '../../../components/Transition/OpacityTransition/OpacityTransition.js';
|
|
@@ -65,6 +65,7 @@ import { Select } from '../../../components/Select/Select.js';
|
|
|
65
65
|
|
|
66
66
|
const UserDataFields = ({ errors, policiesConsentInnerComponentArray, fields, touched, }) => {
|
|
67
67
|
const { fieldsConfig } = useFields();
|
|
68
|
+
const { t } = useTranslation();
|
|
68
69
|
return (jsx("div", { className: 'user-data-fields__fields-column', children: fields === null || fields === void 0 ? void 0 : fields.map(({ name, required, enabled }) => {
|
|
69
70
|
const { label, type, key } = getValueByKey(fieldsConfig, name);
|
|
70
71
|
if (name === 'tShirtSize') {
|
|
@@ -80,7 +81,7 @@ const UserDataFields = ({ errors, policiesConsentInnerComponentArray, fields, to
|
|
|
80
81
|
return (jsx("div", { role: 'group', "aria-labelledby": 'checkbox-group', className: 'user-data-fields__checkbox-container', children: policiesConsentInnerComponentArray === null || policiesConsentInnerComponentArray === void 0 ? void 0 : policiesConsentInnerComponentArray.map((component, index) => (jsxs("div", { className: 'user-data-fields__consent-checkbox', children: [jsx(Field, { copykey: key, as: Checkbox, id: `policiesConsent_${index}`, name: 'policiesConsentArray', type: 'checkbox', value: `${index}` }, `policiesConsent_${index}`), jsx("label", { htmlFor: `policiesConsent_${index}`, className: 'user-data-fields__checkbox-label', children: jsx(Typography, { variant: 'body_small', color: 'secondary', children: component }) })] }, `policiesConsent_${index}`))) }, 'policiesConsentGroup'));
|
|
81
82
|
}
|
|
82
83
|
else if (name === 'email' && !enabled) {
|
|
83
|
-
return (jsx(Tooltip, { content: '
|
|
84
|
+
return (jsx(Tooltip, { content: t('dyn_collect_user_data.update_email_tooltip'), className: 'user-data-fields__tooltip', copykey: 'dyn_collect_user_data.update_email_tooltip', children: jsx(Field, { copykey: key, disabled: true, as: Input, type: type, id: name, name: name, label: label }, name) }, 'disabled-email-tooltip'));
|
|
84
85
|
}
|
|
85
86
|
else {
|
|
86
87
|
return (jsx(Field, { copykey: key, disabled: !enabled, as: Input, type: type, id: name, name: name, label: label, optional: enabled && !required, error: errors[name] && touched[name], message: touched[name] && getDisplayErrorMessage(label, errors[name]) }, name));
|
|
@@ -100,7 +100,7 @@ const MergeUserAccountsView = () => {
|
|
|
100
100
|
throw new utils.DynamicError('Something went wrong, please try again.');
|
|
101
101
|
}
|
|
102
102
|
catch (e) {
|
|
103
|
-
setError('
|
|
103
|
+
setError(t('dyn_merge_user_accounts.errors.merge_error'));
|
|
104
104
|
if (user) {
|
|
105
105
|
setShowAuthFlow(false);
|
|
106
106
|
return;
|
|
@@ -96,7 +96,7 @@ const MergeUserAccountsView = () => {
|
|
|
96
96
|
throw new DynamicError('Something went wrong, please try again.');
|
|
97
97
|
}
|
|
98
98
|
catch (e) {
|
|
99
|
-
setError('
|
|
99
|
+
setError(t('dyn_merge_user_accounts.errors.merge_error'));
|
|
100
100
|
if (user) {
|
|
101
101
|
setShowAuthFlow(false);
|
|
102
102
|
return;
|
|
@@ -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('../../events/dynamicEvents.cjs');
|
|
@@ -29,7 +30,6 @@ require('react-dom');
|
|
|
29
30
|
require('../../context/ThemeContext/ThemeContext.cjs');
|
|
30
31
|
require('@dynamic-labs/types');
|
|
31
32
|
require('yup');
|
|
32
|
-
require('react-i18next');
|
|
33
33
|
require('../../context/MockContext/MockContext.cjs');
|
|
34
34
|
require('../../utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.cjs');
|
|
35
35
|
require('../../context/UserFieldEditorContext/UserFieldEditorContext.cjs');
|
|
@@ -66,6 +66,7 @@ require('react-focus-lock');
|
|
|
66
66
|
const NoQrNotInstalledView = () => {
|
|
67
67
|
const { selectedWalletConnector } = useInternalDynamicContext.useInternalDynamicContext();
|
|
68
68
|
const { walletBook: walletBook$1 } = walletBook.useWalletBookContext();
|
|
69
|
+
const { t } = reactI18next.useTranslation();
|
|
69
70
|
if (!selectedWalletConnector) {
|
|
70
71
|
return null;
|
|
71
72
|
}
|
|
@@ -75,7 +76,10 @@ const NoQrNotInstalledView = () => {
|
|
|
75
76
|
.map(([name, link]) => (jsxRuntime.jsx(WalletHelpLink.WalletHelpLink, { name: name, link: link,
|
|
76
77
|
// justification: we're looping over the keys of walletLinks.desktop
|
|
77
78
|
Icon: getBrowserIcon.getBrowserIcon(name) }, name)));
|
|
78
|
-
return (jsxRuntime.jsxs("div", { className: 'no-qr-code-installed__container', "data-testid": 'no-qr-code-installed', children: [jsxRuntime.jsx("div", { className: 'no-qr-code-installed__img', children: jsxRuntime.jsx(walletBook.WalletIcon, { walletKey: selectedWalletConnector.key, style: { height: pixelToRem.pixelToRem(64), width: pixelToRem.pixelToRem(64) } }) }), jsxRuntime.
|
|
79
|
+
return (jsxRuntime.jsxs("div", { className: 'no-qr-code-installed__container', "data-testid": 'no-qr-code-installed', children: [jsxRuntime.jsx("div", { className: 'no-qr-code-installed__img', children: jsxRuntime.jsx(walletBook.WalletIcon, { walletKey: selectedWalletConnector.key, style: { height: pixelToRem.pixelToRem(64), width: pixelToRem.pixelToRem(64) } }) }), jsxRuntime.jsx(Typography.Typography, { className: 'no-qr-code-installed__typography--title', variant: 'title', copykey: 'dyn_qr_code.wallet_not_installed.install', children: t('dyn_qr_code.wallet_not_installed.install', {
|
|
80
|
+
wallet: walletBook.getWalletBookWallet(walletBook$1, selectedWalletConnector.key)
|
|
81
|
+
.name,
|
|
82
|
+
}) }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', className: 'no-qr-code-installed__typography', color: 'secondary', copykey: 'dyn_qr_code.wallet_not_installed.select', children: t('dyn_qr_code.wallet_not_installed.select') }), jsxRuntime.jsx("div", { className: 'no-qr-code-installed__links-section', children: downloadLinks }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_mini', className: 'no-qr-code-installed__typography', weight: 'medium', color: 'secondary', copykey: 'dyn_qr_code.wallet_not_installed.refresh', children: t('dyn_qr_code.wallet_not_installed.refresh') })] }));
|
|
79
83
|
};
|
|
80
84
|
|
|
81
85
|
exports.NoQrNotInstalledView = NoQrNotInstalledView;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { useTranslation } from 'react-i18next';
|
|
2
3
|
import { useWalletBookContext, getWalletLinks, WalletIcon, getWalletBookWallet } from '@dynamic-labs/wallet-book';
|
|
3
4
|
import 'react';
|
|
4
5
|
import '../../events/dynamicEvents.js';
|
|
@@ -25,7 +26,6 @@ import 'react-dom';
|
|
|
25
26
|
import '../../context/ThemeContext/ThemeContext.js';
|
|
26
27
|
import '@dynamic-labs/types';
|
|
27
28
|
import 'yup';
|
|
28
|
-
import 'react-i18next';
|
|
29
29
|
import '../../context/MockContext/MockContext.js';
|
|
30
30
|
import '../../utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.js';
|
|
31
31
|
import '../../context/UserFieldEditorContext/UserFieldEditorContext.js';
|
|
@@ -62,6 +62,7 @@ import 'react-focus-lock';
|
|
|
62
62
|
const NoQrNotInstalledView = () => {
|
|
63
63
|
const { selectedWalletConnector } = useInternalDynamicContext();
|
|
64
64
|
const { walletBook } = useWalletBookContext();
|
|
65
|
+
const { t } = useTranslation();
|
|
65
66
|
if (!selectedWalletConnector) {
|
|
66
67
|
return null;
|
|
67
68
|
}
|
|
@@ -71,7 +72,10 @@ const NoQrNotInstalledView = () => {
|
|
|
71
72
|
.map(([name, link]) => (jsx(WalletHelpLink, { name: name, link: link,
|
|
72
73
|
// justification: we're looping over the keys of walletLinks.desktop
|
|
73
74
|
Icon: getBrowserIcon(name) }, name)));
|
|
74
|
-
return (jsxs("div", { className: 'no-qr-code-installed__container', "data-testid": 'no-qr-code-installed', children: [jsx("div", { className: 'no-qr-code-installed__img', children: jsx(WalletIcon, { walletKey: selectedWalletConnector.key, style: { height: pixelToRem(64), width: pixelToRem(64) } }) }),
|
|
75
|
+
return (jsxs("div", { className: 'no-qr-code-installed__container', "data-testid": 'no-qr-code-installed', children: [jsx("div", { className: 'no-qr-code-installed__img', children: jsx(WalletIcon, { walletKey: selectedWalletConnector.key, style: { height: pixelToRem(64), width: pixelToRem(64) } }) }), jsx(Typography, { className: 'no-qr-code-installed__typography--title', variant: 'title', copykey: 'dyn_qr_code.wallet_not_installed.install', children: t('dyn_qr_code.wallet_not_installed.install', {
|
|
76
|
+
wallet: getWalletBookWallet(walletBook, selectedWalletConnector.key)
|
|
77
|
+
.name,
|
|
78
|
+
}) }), jsx(Typography, { variant: 'body_normal', className: 'no-qr-code-installed__typography', color: 'secondary', copykey: 'dyn_qr_code.wallet_not_installed.select', children: t('dyn_qr_code.wallet_not_installed.select') }), jsx("div", { className: 'no-qr-code-installed__links-section', children: downloadLinks }), jsx(Typography, { variant: 'body_mini', className: 'no-qr-code-installed__typography', weight: 'medium', color: 'secondary', copykey: 'dyn_qr_code.wallet_not_installed.refresh', children: t('dyn_qr_code.wallet_not_installed.refresh') })] }));
|
|
75
79
|
};
|
|
76
80
|
|
|
77
81
|
export { NoQrNotInstalledView };
|
|
@@ -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
|
require('react');
|
|
7
8
|
require('../../events/dynamicEvents.cjs');
|
|
8
9
|
require('@dynamic-labs/utils');
|
|
@@ -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,9 +61,14 @@ require('../../components/Popper/PopperContext/PopperContext.cjs');
|
|
|
61
61
|
require('react-focus-lock');
|
|
62
62
|
|
|
63
63
|
const capitalize = (value) => value[0].toUpperCase() + value.slice(1);
|
|
64
|
-
const WalletHelpLink = ({ name, link, Icon }) =>
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
64
|
+
const WalletHelpLink = ({ name, link, Icon }) => {
|
|
65
|
+
const { t } = reactI18next.useTranslation();
|
|
66
|
+
return (jsxRuntime.jsx("div", { className: 'wallet-help-link', children: jsxRuntime.jsxs("a", { className: 'wallet-help-link__anchor', href: link, target: '_blank', rel: 'noreferrer', children: [jsxRuntime.jsx(Icon, { style: {
|
|
67
|
+
height: '1.5rem',
|
|
68
|
+
width: '1.5rem',
|
|
69
|
+
} }), jsxRuntime.jsx(Typography.Typography, { variant: 'button_primary', weight: 'medium', copykey: 'dyn_qr_code.wallet_not_installed.browser_install', children: t('dyn_qr_code.wallet_not_installed.browser_install', {
|
|
70
|
+
browser: capitalize(name),
|
|
71
|
+
}) })] }) }));
|
|
72
|
+
};
|
|
68
73
|
|
|
69
74
|
exports.WalletHelpLink = WalletHelpLink;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { useTranslation } from 'react-i18next';
|
|
2
3
|
import 'react';
|
|
3
4
|
import '../../events/dynamicEvents.js';
|
|
4
5
|
import '@dynamic-labs/utils';
|
|
@@ -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,9 +57,14 @@ import '../../components/Popper/PopperContext/PopperContext.js';
|
|
|
57
57
|
import 'react-focus-lock';
|
|
58
58
|
|
|
59
59
|
const capitalize = (value) => value[0].toUpperCase() + value.slice(1);
|
|
60
|
-
const WalletHelpLink = ({ name, link, Icon }) =>
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
60
|
+
const WalletHelpLink = ({ name, link, Icon }) => {
|
|
61
|
+
const { t } = useTranslation();
|
|
62
|
+
return (jsx("div", { className: 'wallet-help-link', children: jsxs("a", { className: 'wallet-help-link__anchor', href: link, target: '_blank', rel: 'noreferrer', children: [jsx(Icon, { style: {
|
|
63
|
+
height: '1.5rem',
|
|
64
|
+
width: '1.5rem',
|
|
65
|
+
} }), jsx(Typography, { variant: 'button_primary', weight: 'medium', copykey: 'dyn_qr_code.wallet_not_installed.browser_install', children: t('dyn_qr_code.wallet_not_installed.browser_install', {
|
|
66
|
+
browser: capitalize(name),
|
|
67
|
+
}) })] }) }));
|
|
68
|
+
};
|
|
64
69
|
|
|
65
70
|
export { WalletHelpLink };
|
|
@@ -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 utils = require('@dynamic-labs/utils');
|
|
7
8
|
var walletBook = require('@dynamic-labs/wallet-book');
|
|
8
9
|
require('react');
|
|
@@ -29,7 +30,6 @@ require('react-dom');
|
|
|
29
30
|
require('../../context/ThemeContext/ThemeContext.cjs');
|
|
30
31
|
require('@dynamic-labs/types');
|
|
31
32
|
require('yup');
|
|
32
|
-
require('react-i18next');
|
|
33
33
|
require('../../context/MockContext/MockContext.cjs');
|
|
34
34
|
require('../../utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.cjs');
|
|
35
35
|
require('../../context/UserFieldEditorContext/UserFieldEditorContext.cjs');
|
|
@@ -64,14 +64,17 @@ require('react-focus-lock');
|
|
|
64
64
|
|
|
65
65
|
const PendingConnectView = () => {
|
|
66
66
|
const { selectedWalletConnector: walletConnector } = useInternalDynamicContext.useInternalDynamicContext();
|
|
67
|
+
const { t } = reactI18next.useTranslation();
|
|
67
68
|
const iconSize = 94;
|
|
68
69
|
const icon = (jsxRuntime.jsx(walletBook.WalletIcon, { walletKey: walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.key, style: {
|
|
69
70
|
height: pixelToRem.pixelToRem(iconSize * IconWithSpinner.iconRatio),
|
|
70
71
|
width: pixelToRem.pixelToRem(iconSize * IconWithSpinner.iconRatio),
|
|
71
72
|
} }));
|
|
72
|
-
return (jsxRuntime.jsxs("div", { className: 'pending-connect__container', children: [jsxRuntime.jsx(IconWithSpinner.IconWithSpinner, { Icon: icon, iconSize: iconSize, isSpinning: true, className: 'pending-connect__icon-with-spinner' }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'regular', className: 'pending-connect__copy-text',
|
|
73
|
-
? '
|
|
74
|
-
: '
|
|
73
|
+
return (jsxRuntime.jsxs("div", { className: 'pending-connect__container', children: [jsxRuntime.jsx(IconWithSpinner.IconWithSpinner, { Icon: icon, iconSize: iconSize, isSpinning: true, className: 'pending-connect__icon-with-spinner' }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'regular', className: 'pending-connect__copy-text', copykey: utils.isMobile()
|
|
74
|
+
? 'dyn_pending_connection.mobile'
|
|
75
|
+
: 'dyn_pending_connection.computer', children: utils.isMobile()
|
|
76
|
+
? t('dyn_pending_connection.mobile')
|
|
77
|
+
: t('dyn_pending_connection.computer') })] }));
|
|
75
78
|
};
|
|
76
79
|
|
|
77
80
|
exports.PendingConnectView = PendingConnectView;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { useTranslation } from 'react-i18next';
|
|
2
3
|
import { isMobile } from '@dynamic-labs/utils';
|
|
3
4
|
import { WalletIcon } from '@dynamic-labs/wallet-book';
|
|
4
5
|
import 'react';
|
|
@@ -25,7 +26,6 @@ import 'react-dom';
|
|
|
25
26
|
import '../../context/ThemeContext/ThemeContext.js';
|
|
26
27
|
import '@dynamic-labs/types';
|
|
27
28
|
import 'yup';
|
|
28
|
-
import 'react-i18next';
|
|
29
29
|
import '../../context/MockContext/MockContext.js';
|
|
30
30
|
import '../../utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.js';
|
|
31
31
|
import '../../context/UserFieldEditorContext/UserFieldEditorContext.js';
|
|
@@ -60,14 +60,17 @@ import 'react-focus-lock';
|
|
|
60
60
|
|
|
61
61
|
const PendingConnectView = () => {
|
|
62
62
|
const { selectedWalletConnector: walletConnector } = useInternalDynamicContext();
|
|
63
|
+
const { t } = useTranslation();
|
|
63
64
|
const iconSize = 94;
|
|
64
65
|
const icon = (jsx(WalletIcon, { walletKey: walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.key, style: {
|
|
65
66
|
height: pixelToRem(iconSize * iconRatio),
|
|
66
67
|
width: pixelToRem(iconSize * iconRatio),
|
|
67
68
|
} }));
|
|
68
|
-
return (jsxs("div", { className: 'pending-connect__container', children: [jsx(IconWithSpinner, { Icon: icon, iconSize: iconSize, isSpinning: true, className: 'pending-connect__icon-with-spinner' }), jsx(Typography, { variant: 'body_normal', weight: 'regular', className: 'pending-connect__copy-text',
|
|
69
|
-
? '
|
|
70
|
-
: '
|
|
69
|
+
return (jsxs("div", { className: 'pending-connect__container', children: [jsx(IconWithSpinner, { Icon: icon, iconSize: iconSize, isSpinning: true, className: 'pending-connect__icon-with-spinner' }), jsx(Typography, { variant: 'body_normal', weight: 'regular', className: 'pending-connect__copy-text', copykey: isMobile()
|
|
70
|
+
? 'dyn_pending_connection.mobile'
|
|
71
|
+
: 'dyn_pending_connection.computer', children: isMobile()
|
|
72
|
+
? t('dyn_pending_connection.mobile')
|
|
73
|
+
: t('dyn_pending_connection.computer') })] }));
|
|
71
74
|
};
|
|
72
75
|
|
|
73
76
|
export { PendingConnectView };
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var _tslib = require('../../../../_virtual/_tslib.cjs');
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
7
|
var React = require('react');
|
|
8
|
+
var reactI18next = require('react-i18next');
|
|
8
9
|
var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
|
|
9
10
|
var walletBook = require('@dynamic-labs/wallet-book');
|
|
10
11
|
var classNames = require('../../utils/functions/classNames/classNames.cjs');
|
|
@@ -33,7 +34,6 @@ require('react-dom');
|
|
|
33
34
|
require('../../context/ThemeContext/ThemeContext.cjs');
|
|
34
35
|
require('@dynamic-labs/types');
|
|
35
36
|
require('yup');
|
|
36
|
-
require('react-i18next');
|
|
37
37
|
require('../../context/MockContext/MockContext.cjs');
|
|
38
38
|
require('../../utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.cjs');
|
|
39
39
|
require('../../context/UserFieldEditorContext/UserFieldEditorContext.cjs');
|
|
@@ -71,6 +71,7 @@ const PendingSignatureView = () => {
|
|
|
71
71
|
const [loading, setLoading] = React.useState(false);
|
|
72
72
|
const { selectedWalletConnector: walletConnector } = useInternalDynamicContext.useInternalDynamicContext();
|
|
73
73
|
const { signAlreadyConnectedUser } = useConnectAndSignSplitSteps.useConnectAndSignSplitSteps();
|
|
74
|
+
const { t } = reactI18next.useTranslation();
|
|
74
75
|
const iconSize = 96;
|
|
75
76
|
/**
|
|
76
77
|
* The following check on Phantom+Ledger will be fixed in a future ticket.
|
|
@@ -96,12 +97,14 @@ const PendingSignatureView = () => {
|
|
|
96
97
|
width: pixelToRem.pixelToRem(iconSize * IconWithSpinner.iconRatio),
|
|
97
98
|
} }));
|
|
98
99
|
const typographyBodyCopy = isPhantomLedger
|
|
99
|
-
?
|
|
100
|
-
: '
|
|
101
|
-
return (jsxRuntime.jsxs("div", { className: 'pending-signature__container', "data-testid": 'pending-signature-view', children: [jsxRuntime.jsx(IconWithSpinner.IconWithSpinner, { Icon: icon, iconSize: iconSize, isSpinning: true, indicator: 'connected', className: 'pending-signature__icon-with-spinner' }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'regular', className: classNames.classNames('pending-signature__copy'),
|
|
100
|
+
? t('dyn_pending_signature.phantom_ledger_sign')
|
|
101
|
+
: t('dyn_pending_signature.regular_sign_description');
|
|
102
|
+
return (jsxRuntime.jsxs("div", { className: 'pending-signature__container', "data-testid": 'pending-signature-view', children: [jsxRuntime.jsx(IconWithSpinner.IconWithSpinner, { Icon: icon, iconSize: iconSize, isSpinning: true, indicator: 'connected', className: 'pending-signature__icon-with-spinner' }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'regular', className: classNames.classNames('pending-signature__copy'), copykey: isPhantomLedger
|
|
103
|
+
? 'dyn_pending_signature.phantom_ledger_sign'
|
|
104
|
+
: 'dyn_pending_signature.regular_sign_description', children: typographyBodyCopy }), isPhantomLedger && (jsxRuntime.jsxs(Typography.Typography, { variant: 'body_small', weight: 'regular', className: classNames.classNames('pending-signature__copy', 'pending-signature__copy--mini'), copykey: 'dyn_pending_signature.phantom_ledger_warning', children: [jsxRuntime.jsx("strong", { children: t('dyn_pending_signature.note') }), t('dyn_pending_signature.phantom_ledger_warning')] })), requiresTwoStepAuthentication.requiresTwoStepAuthentication(walletConnector) && (jsxRuntime.jsx(Button.Button, { buttonClassName: 'pending-signature__button', onClick: handleClick, loading: loading, buttonVariant: 'primary', buttonPadding: 'large', expanded: true, typographyProps: {
|
|
102
105
|
variant: 'button_primary',
|
|
103
106
|
weight: 'medium',
|
|
104
|
-
},
|
|
107
|
+
}, copykey: 'dyn_pending_signature.click_to_sign', children: t('dyn_pending_signature.click_to_sign') }))] }));
|
|
105
108
|
};
|
|
106
109
|
|
|
107
110
|
exports.PendingSignatureView = PendingSignatureView;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { __awaiter } from '../../../../_virtual/_tslib.js';
|
|
2
2
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
3
|
import { useState } from 'react';
|
|
4
|
+
import { useTranslation } from 'react-i18next';
|
|
4
5
|
import { PhantomLedgerWalletName } from '@dynamic-labs/wallet-connector-core';
|
|
5
6
|
import { WalletIcon } from '@dynamic-labs/wallet-book';
|
|
6
7
|
import { classNames } from '../../utils/functions/classNames/classNames.js';
|
|
@@ -29,7 +30,6 @@ import 'react-dom';
|
|
|
29
30
|
import '../../context/ThemeContext/ThemeContext.js';
|
|
30
31
|
import '@dynamic-labs/types';
|
|
31
32
|
import 'yup';
|
|
32
|
-
import 'react-i18next';
|
|
33
33
|
import '../../context/MockContext/MockContext.js';
|
|
34
34
|
import '../../utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.js';
|
|
35
35
|
import '../../context/UserFieldEditorContext/UserFieldEditorContext.js';
|
|
@@ -67,6 +67,7 @@ const PendingSignatureView = () => {
|
|
|
67
67
|
const [loading, setLoading] = useState(false);
|
|
68
68
|
const { selectedWalletConnector: walletConnector } = useInternalDynamicContext();
|
|
69
69
|
const { signAlreadyConnectedUser } = useConnectAndSignSplitSteps();
|
|
70
|
+
const { t } = useTranslation();
|
|
70
71
|
const iconSize = 96;
|
|
71
72
|
/**
|
|
72
73
|
* The following check on Phantom+Ledger will be fixed in a future ticket.
|
|
@@ -92,12 +93,14 @@ const PendingSignatureView = () => {
|
|
|
92
93
|
width: pixelToRem(iconSize * iconRatio),
|
|
93
94
|
} }));
|
|
94
95
|
const typographyBodyCopy = isPhantomLedger
|
|
95
|
-
?
|
|
96
|
-
: '
|
|
97
|
-
return (jsxs("div", { className: 'pending-signature__container', "data-testid": 'pending-signature-view', children: [jsx(IconWithSpinner, { Icon: icon, iconSize: iconSize, isSpinning: true, indicator: 'connected', className: 'pending-signature__icon-with-spinner' }), jsx(Typography, { variant: 'body_normal', weight: 'regular', className: classNames('pending-signature__copy'),
|
|
96
|
+
? t('dyn_pending_signature.phantom_ledger_sign')
|
|
97
|
+
: t('dyn_pending_signature.regular_sign_description');
|
|
98
|
+
return (jsxs("div", { className: 'pending-signature__container', "data-testid": 'pending-signature-view', children: [jsx(IconWithSpinner, { Icon: icon, iconSize: iconSize, isSpinning: true, indicator: 'connected', className: 'pending-signature__icon-with-spinner' }), jsx(Typography, { variant: 'body_normal', weight: 'regular', className: classNames('pending-signature__copy'), copykey: isPhantomLedger
|
|
99
|
+
? 'dyn_pending_signature.phantom_ledger_sign'
|
|
100
|
+
: 'dyn_pending_signature.regular_sign_description', children: typographyBodyCopy }), isPhantomLedger && (jsxs(Typography, { variant: 'body_small', weight: 'regular', className: classNames('pending-signature__copy', 'pending-signature__copy--mini'), copykey: 'dyn_pending_signature.phantom_ledger_warning', children: [jsx("strong", { children: t('dyn_pending_signature.note') }), t('dyn_pending_signature.phantom_ledger_warning')] })), requiresTwoStepAuthentication(walletConnector) && (jsx(Button, { buttonClassName: 'pending-signature__button', onClick: handleClick, loading: loading, buttonVariant: 'primary', buttonPadding: 'large', expanded: true, typographyProps: {
|
|
98
101
|
variant: 'button_primary',
|
|
99
102
|
weight: 'medium',
|
|
100
|
-
},
|
|
103
|
+
}, copykey: 'dyn_pending_signature.click_to_sign', children: t('dyn_pending_signature.click_to_sign') }))] }));
|
|
101
104
|
};
|
|
102
105
|
|
|
103
106
|
export { PendingSignatureView };
|
|
@@ -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 MockedQrCode = require('../../../components/MockedQrCode/MockedQrCode.cjs');
|
|
7
8
|
require('@dynamic-labs/sdk-api');
|
|
8
9
|
require('../../../shared/logger.cjs');
|
|
@@ -33,7 +34,6 @@ require('react-dom');
|
|
|
33
34
|
require('../../../context/ThemeContext/ThemeContext.cjs');
|
|
34
35
|
require('@dynamic-labs/types');
|
|
35
36
|
require('yup');
|
|
36
|
-
require('react-i18next');
|
|
37
37
|
require('../../../context/MockContext/MockContext.cjs');
|
|
38
38
|
require('../../../utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.cjs');
|
|
39
39
|
require('../../../context/UserFieldEditorContext/UserFieldEditorContext.cjs');
|
|
@@ -67,12 +67,15 @@ require('../../../components/Popper/Popper/Popper.cjs');
|
|
|
67
67
|
require('../../../components/Popper/PopperContext/PopperContext.cjs');
|
|
68
68
|
require('react-focus-lock');
|
|
69
69
|
|
|
70
|
-
const QrCodeContainer = ({ accentColor, walletKey, walletName, qrcodeValue, Icon: WalletIcon, showCopyToClipboardButton = false, desktopUri, showQrCodeMessage, }) =>
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
70
|
+
const QrCodeContainer = ({ accentColor, walletKey, walletName, qrcodeValue, Icon: WalletIcon, showCopyToClipboardButton = false, desktopUri, showQrCodeMessage, }) => {
|
|
71
|
+
const { t } = reactI18next.useTranslation();
|
|
72
|
+
return (jsxRuntime.jsxs("div", { className: classNames.classNames('qrcode-container__container', {
|
|
73
|
+
'qrcode-container__container--message': showQrCodeMessage,
|
|
74
|
+
}), children: [jsxRuntime.jsxs("div", { className: 'qrcode-container__top', children: [qrcodeValue ? (jsxRuntime.jsx(QRCode.QRCode, { Icon: WalletIcon, accentColor: accentColor, value: qrcodeValue, logoSize: 50, walletKey: walletKey })) : (
|
|
75
|
+
// this div exists to give the parent a child, so that the parent
|
|
76
|
+
// takes on its given width and height. the result is stable
|
|
77
|
+
// rendering of this component, without this there is a brief flash
|
|
78
|
+
jsxRuntime.jsx("div", {})), jsxRuntime.jsx(MockedQrCode.MockedQrCode, {}), ((showCopyToClipboardButton && qrcodeValue) || desktopUri) && (jsxRuntime.jsxs("div", { className: 'button-container', children: [showCopyToClipboardButton && qrcodeValue && (jsxRuntime.jsx(CopyButton.CopyButton, { textToCopy: qrcodeValue, copykey: 'dyn_qr_code.copy_button', children: jsxRuntime.jsxs("div", { className: 'button__content', children: [jsxRuntime.jsx(Icon.Icon, { size: 'small', color: 'text-tertiary', children: jsxRuntime.jsx(link.ReactComponent, {}) }), t('dyn_qr_code.copy_button')] }) })), desktopUri && (jsxRuntime.jsxs(TextButton.TextButton, { className: 'desktop-button', onClick: () => window.open(desktopUri), copykey: 'dyn_qr_code.open_button', children: [jsxRuntime.jsx(Icon.Icon, { size: 'xsmall', color: 'text-tertiary', children: jsxRuntime.jsx(externalLink.ReactComponent, {}) }), t('dyn_qr_code.open_button', { wallet: walletName })] }))] }))] }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'secondary', weight: 'regular', className: 'qrcode-container__content', copykey: 'dyn_qr_code.scan_title', children: t('dyn_qr_code.scan_title') })] }));
|
|
79
|
+
};
|
|
77
80
|
|
|
78
81
|
exports.QrCodeContainer = QrCodeContainer;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useTranslation } from 'react-i18next';
|
|
2
3
|
import { MockedQrCode } from '../../../components/MockedQrCode/MockedQrCode.js';
|
|
3
4
|
import '@dynamic-labs/sdk-api';
|
|
4
5
|
import '../../../shared/logger.js';
|
|
@@ -29,7 +30,6 @@ import 'react-dom';
|
|
|
29
30
|
import '../../../context/ThemeContext/ThemeContext.js';
|
|
30
31
|
import '@dynamic-labs/types';
|
|
31
32
|
import 'yup';
|
|
32
|
-
import 'react-i18next';
|
|
33
33
|
import '../../../context/MockContext/MockContext.js';
|
|
34
34
|
import '../../../utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.js';
|
|
35
35
|
import '../../../context/UserFieldEditorContext/UserFieldEditorContext.js';
|
|
@@ -63,12 +63,15 @@ import '../../../components/Popper/Popper/Popper.js';
|
|
|
63
63
|
import '../../../components/Popper/PopperContext/PopperContext.js';
|
|
64
64
|
import 'react-focus-lock';
|
|
65
65
|
|
|
66
|
-
const QrCodeContainer = ({ accentColor, walletKey, walletName, qrcodeValue, Icon: WalletIcon, showCopyToClipboardButton = false, desktopUri, showQrCodeMessage, }) =>
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
66
|
+
const QrCodeContainer = ({ accentColor, walletKey, walletName, qrcodeValue, Icon: WalletIcon, showCopyToClipboardButton = false, desktopUri, showQrCodeMessage, }) => {
|
|
67
|
+
const { t } = useTranslation();
|
|
68
|
+
return (jsxs("div", { className: classNames('qrcode-container__container', {
|
|
69
|
+
'qrcode-container__container--message': showQrCodeMessage,
|
|
70
|
+
}), children: [jsxs("div", { className: 'qrcode-container__top', children: [qrcodeValue ? (jsx(QRCode, { Icon: WalletIcon, accentColor: accentColor, value: qrcodeValue, logoSize: 50, walletKey: walletKey })) : (
|
|
71
|
+
// this div exists to give the parent a child, so that the parent
|
|
72
|
+
// takes on its given width and height. the result is stable
|
|
73
|
+
// rendering of this component, without this there is a brief flash
|
|
74
|
+
jsx("div", {})), jsx(MockedQrCode, {}), ((showCopyToClipboardButton && qrcodeValue) || desktopUri) && (jsxs("div", { className: 'button-container', children: [showCopyToClipboardButton && qrcodeValue && (jsx(CopyButton, { textToCopy: qrcodeValue, copykey: 'dyn_qr_code.copy_button', children: jsxs("div", { className: 'button__content', children: [jsx(Icon, { size: 'small', color: 'text-tertiary', children: jsx(SvgLink, {}) }), t('dyn_qr_code.copy_button')] }) })), desktopUri && (jsxs(TextButton, { className: 'desktop-button', onClick: () => window.open(desktopUri), copykey: 'dyn_qr_code.open_button', children: [jsx(Icon, { size: 'xsmall', color: 'text-tertiary', children: jsx(SvgExternalLink, {}) }), t('dyn_qr_code.open_button', { wallet: walletName })] }))] }))] }), jsx(Typography, { variant: 'body_normal', color: 'secondary', weight: 'regular', className: 'qrcode-container__content', copykey: 'dyn_qr_code.scan_title', children: t('dyn_qr_code.scan_title') })] }));
|
|
75
|
+
};
|
|
73
76
|
|
|
74
77
|
export { QrCodeContainer };
|