@dynamic-labs/sdk-react-core 2.0.0-alpha.26 → 2.0.0-alpha.27
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 +9 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +13 -13
- package/src/lib/components/CopyButton/CopyButton.cjs +7 -2
- package/src/lib/components/CopyButton/CopyButton.d.ts +4 -2
- package/src/lib/components/CopyButton/CopyButton.js +7 -2
- package/src/lib/components/QrCodeWrapper/QrCodeContainer/QrCodeContainer.cjs +19 -10
- package/src/lib/components/QrCodeWrapper/QrCodeContainer/QrCodeContainer.js +19 -10
- package/src/lib/layout/DynamicAuthLayout/Header/header.cjs +11 -2
- package/src/lib/layout/DynamicAuthLayout/Header/header.js +11 -2
- package/src/lib/locale/en/translation.cjs +7 -4
- package/src/lib/locale/en/translation.d.ts +5 -2
- package/src/lib/locale/en/translation.js +7 -4
- package/src/lib/shared/consts/index.cjs +1 -1
- package/src/lib/shared/consts/index.js +1 -1
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/functions/walletListBuilder/walletListBuilder.cjs +0 -1
- package/src/lib/utils/functions/walletListBuilder/walletListBuilder.js +0 -1
- package/src/lib/utils/hooks/authenticationHooks/helpers/showPendingConnectView.cjs +2 -2
- package/src/lib/utils/hooks/authenticationHooks/helpers/showPendingConnectView.js +2 -2
- package/src/lib/views/LoginView/sections/PhoneNumberSignInSection/useSubmitPhoneNumber/useSubmitPhoneNumber.cjs +3 -0
- package/src/lib/views/LoginView/sections/PhoneNumberSignInSection/useSubmitPhoneNumber/useSubmitPhoneNumber.js +3 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
|
|
2
|
+
## [2.0.0-alpha.27](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.26...v2.0.0-alpha.27) (2024-04-09)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
* coinbase improvements ([#5268](https://github.com/dynamic-labs/DynamicAuth/issues/5268)) ([c10a6de](https://github.com/dynamic-labs/DynamicAuth/commit/c10a6debcacff6cd97f2436fbde387f85faa5682))
|
|
8
|
+
* show qr code for metamask on desktop when not installed ([#5262](https://github.com/dynamic-labs/DynamicAuth/issues/5262)) ([1dcb4d9](https://github.com/dynamic-labs/DynamicAuth/commit/1dcb4d98de8a95f6b11d7bad90b9059110087385))
|
|
9
|
+
* update title of hardware wallet select screen ([#5270](https://github.com/dynamic-labs/DynamicAuth/issues/5270)) ([6e8fe17](https://github.com/dynamic-labs/DynamicAuth/commit/6e8fe17306677786ccf528b97ab673b9ae6b57b9))
|
|
10
|
+
|
|
2
11
|
## [2.0.0-alpha.26](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.25...v2.0.0-alpha.26) (2024-04-08)
|
|
3
12
|
|
|
4
13
|
|
package/package.cjs
CHANGED
package/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/sdk-react-core",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.27",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/dynamic-labs/DynamicAuth.git",
|
|
@@ -17,18 +17,18 @@
|
|
|
17
17
|
"react-i18next": "13.5.0",
|
|
18
18
|
"yup": "0.32.11",
|
|
19
19
|
"react-international-phone": "4.2.5",
|
|
20
|
-
"@dynamic-labs/ethereum": "2.0.0-alpha.
|
|
21
|
-
"@dynamic-labs/iconic": "2.0.0-alpha.
|
|
22
|
-
"@dynamic-labs/logger": "2.0.0-alpha.
|
|
23
|
-
"@dynamic-labs/multi-wallet": "2.0.0-alpha.
|
|
24
|
-
"@dynamic-labs/rpc-provider-ethereum": "2.0.0-alpha.
|
|
25
|
-
"@dynamic-labs/rpc-provider-solana": "2.0.0-alpha.
|
|
26
|
-
"@dynamic-labs/rpc-providers": "2.0.0-alpha.
|
|
27
|
-
"@dynamic-labs/types": "2.0.0-alpha.
|
|
28
|
-
"@dynamic-labs/utils": "2.0.0-alpha.
|
|
29
|
-
"@dynamic-labs/viem-utils": "2.0.0-alpha.
|
|
30
|
-
"@dynamic-labs/wallet-book": "2.0.0-alpha.
|
|
31
|
-
"@dynamic-labs/wallet-connector-core": "2.0.0-alpha.
|
|
20
|
+
"@dynamic-labs/ethereum": "2.0.0-alpha.27",
|
|
21
|
+
"@dynamic-labs/iconic": "2.0.0-alpha.27",
|
|
22
|
+
"@dynamic-labs/logger": "2.0.0-alpha.27",
|
|
23
|
+
"@dynamic-labs/multi-wallet": "2.0.0-alpha.27",
|
|
24
|
+
"@dynamic-labs/rpc-provider-ethereum": "2.0.0-alpha.27",
|
|
25
|
+
"@dynamic-labs/rpc-provider-solana": "2.0.0-alpha.27",
|
|
26
|
+
"@dynamic-labs/rpc-providers": "2.0.0-alpha.27",
|
|
27
|
+
"@dynamic-labs/types": "2.0.0-alpha.27",
|
|
28
|
+
"@dynamic-labs/utils": "2.0.0-alpha.27",
|
|
29
|
+
"@dynamic-labs/viem-utils": "2.0.0-alpha.27",
|
|
30
|
+
"@dynamic-labs/wallet-book": "2.0.0-alpha.27",
|
|
31
|
+
"@dynamic-labs/wallet-connector-core": "2.0.0-alpha.27",
|
|
32
32
|
"eventemitter3": "5.0.1"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
@@ -6,16 +6,21 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var classNames = require('../../utils/functions/classNames/classNames.cjs');
|
|
8
8
|
var TextButton = require('../TextButton/TextButton.cjs');
|
|
9
|
+
var Button = require('../Button/Button.cjs');
|
|
9
10
|
var Tooltip = require('../Tooltip/Tooltip.cjs');
|
|
10
11
|
|
|
11
|
-
const CopyButton = ({ children, className = '', textToCopy, onClick, }) => {
|
|
12
|
+
const CopyButton = ({ children, className = '', textToCopy, onClick, variant = 'text', copykey, buttonPadding = 'small', buttonVariant = 'primary', buttonClassName = '', startSlot, }) => {
|
|
12
13
|
const [copied, setCopied] = React.useState(false);
|
|
13
14
|
const copyToClipboard = () => {
|
|
14
15
|
navigator.clipboard.writeText(textToCopy);
|
|
15
16
|
setCopied(true);
|
|
16
17
|
onClick === null || onClick === void 0 ? void 0 : onClick();
|
|
17
18
|
};
|
|
18
|
-
|
|
19
|
+
const CopyButtonTooltip = () => (jsxRuntime.jsx(Tooltip.Tooltip, { className: 'copy-button__tooltip', content: copied ? 'Copied' : 'Copy', children: children }));
|
|
20
|
+
if (variant === 'text') {
|
|
21
|
+
return (jsxRuntime.jsx(TextButton.TextButton, { className: classNames.classNames('copy-button__container', className), onClick: () => copyToClipboard(), onMouseLeave: () => setCopied(false), copykey: copykey, children: jsxRuntime.jsx(CopyButtonTooltip, {}) }));
|
|
22
|
+
}
|
|
23
|
+
return (jsxRuntime.jsx(Button.Button, { expanded: true, buttonPadding: buttonPadding, buttonVariant: buttonVariant, buttonClassName: buttonClassName, onClick: () => copyToClipboard(), copykey: copykey, startSlot: startSlot, children: jsxRuntime.jsx(CopyButtonTooltip, {}) }));
|
|
19
24
|
};
|
|
20
25
|
|
|
21
26
|
exports.CopyButton = CopyButton;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { ReactNode, ComponentPropsWithoutRef } from 'react';
|
|
2
2
|
import { CopyKey } from '../../shared';
|
|
3
|
+
import { ButtonProps } from '../Button/Button';
|
|
3
4
|
type Props = ComponentPropsWithoutRef<'button'> & {
|
|
4
5
|
children: ReactNode;
|
|
5
6
|
className?: string;
|
|
6
7
|
onClick?: VoidFunction;
|
|
7
8
|
textToCopy: string;
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
variant?: 'text' | 'button';
|
|
10
|
+
} & CopyKey & Pick<ButtonProps, 'buttonPadding' | 'buttonVariant' | 'buttonClassName' | 'startSlot'>;
|
|
11
|
+
export declare const CopyButton: ({ children, className, textToCopy, onClick, variant, copykey, buttonPadding, buttonVariant, buttonClassName, startSlot, }: Props) => JSX.Element;
|
|
10
12
|
export {};
|
|
@@ -2,16 +2,21 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
2
2
|
import { useState } from 'react';
|
|
3
3
|
import { classNames } from '../../utils/functions/classNames/classNames.js';
|
|
4
4
|
import { TextButton } from '../TextButton/TextButton.js';
|
|
5
|
+
import { Button } from '../Button/Button.js';
|
|
5
6
|
import { Tooltip } from '../Tooltip/Tooltip.js';
|
|
6
7
|
|
|
7
|
-
const CopyButton = ({ children, className = '', textToCopy, onClick, }) => {
|
|
8
|
+
const CopyButton = ({ children, className = '', textToCopy, onClick, variant = 'text', copykey, buttonPadding = 'small', buttonVariant = 'primary', buttonClassName = '', startSlot, }) => {
|
|
8
9
|
const [copied, setCopied] = useState(false);
|
|
9
10
|
const copyToClipboard = () => {
|
|
10
11
|
navigator.clipboard.writeText(textToCopy);
|
|
11
12
|
setCopied(true);
|
|
12
13
|
onClick === null || onClick === void 0 ? void 0 : onClick();
|
|
13
14
|
};
|
|
14
|
-
|
|
15
|
+
const CopyButtonTooltip = () => (jsx(Tooltip, { className: 'copy-button__tooltip', content: copied ? 'Copied' : 'Copy', children: children }));
|
|
16
|
+
if (variant === 'text') {
|
|
17
|
+
return (jsx(TextButton, { className: classNames('copy-button__container', className), onClick: () => copyToClipboard(), onMouseLeave: () => setCopied(false), copykey: copykey, children: jsx(CopyButtonTooltip, {}) }));
|
|
18
|
+
}
|
|
19
|
+
return (jsx(Button, { expanded: true, buttonPadding: buttonPadding, buttonVariant: buttonVariant, buttonClassName: buttonClassName, onClick: () => copyToClipboard(), copykey: copykey, startSlot: startSlot, children: jsx(CopyButtonTooltip, {}) }));
|
|
15
20
|
};
|
|
16
21
|
|
|
17
22
|
export { CopyButton };
|
|
@@ -9,7 +9,7 @@ require('@dynamic-labs/sdk-api');
|
|
|
9
9
|
require('../../../shared/logger.cjs');
|
|
10
10
|
require('@dynamic-labs/iconic');
|
|
11
11
|
require('@dynamic-labs/wallet-connector-core');
|
|
12
|
-
require('../../../context/ViewContext/ViewContext.cjs');
|
|
12
|
+
var ViewContext = require('../../../context/ViewContext/ViewContext.cjs');
|
|
13
13
|
require('react');
|
|
14
14
|
var externalLink = require('../../../shared/assets/externalLink.cjs');
|
|
15
15
|
var link = require('../../../shared/assets/link.cjs');
|
|
@@ -62,6 +62,7 @@ require('../../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
|
|
|
62
62
|
require('../../IconButton/IconButton.cjs');
|
|
63
63
|
require('../../MenuList/Dropdown/Dropdown.cjs');
|
|
64
64
|
require('formik');
|
|
65
|
+
var Button = require('../../Button/Button.cjs');
|
|
65
66
|
require('../../../views/TransactionConfirmationView/helpers/transactionErrorMessage.cjs');
|
|
66
67
|
require('../../Alert/Alert.cjs');
|
|
67
68
|
require('../../Input/Input.cjs');
|
|
@@ -71,7 +72,6 @@ require('../../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCa
|
|
|
71
72
|
var CopyButton = require('../../CopyButton/CopyButton.cjs');
|
|
72
73
|
require('../../InlineWidget/InlineWidget.cjs');
|
|
73
74
|
require('../../IsBrowser/IsBrowser.cjs');
|
|
74
|
-
var TextButton = require('../../TextButton/TextButton.cjs');
|
|
75
75
|
require('../../Popper/Popper/Popper.cjs');
|
|
76
76
|
require('../../Popper/PopperContext/PopperContext.cjs');
|
|
77
77
|
var QRCode = require('../../QRCode/QRCode.cjs');
|
|
@@ -82,16 +82,25 @@ require('../../../views/LoginView/sections/PhoneNumberSignInSection/PhoneNumberS
|
|
|
82
82
|
|
|
83
83
|
const QrCodeContainer = ({ accentColor, walletConnector, qrcodeValue, Icon: MainIcon, showCopyToClipboardButton = false, desktopUri, showQrCodeMessage, showQrCodeImage, }) => {
|
|
84
84
|
const { t } = reactI18next.useTranslation();
|
|
85
|
+
const { setView } = ViewContext.useViewContext();
|
|
86
|
+
const renderAppOrExtensionButton = () => {
|
|
87
|
+
if ((walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.key) === 'walletconnect') {
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
if (desktopUri) {
|
|
91
|
+
return (jsxRuntime.jsx(Button.Button, { expanded: true, dataTestId: 'get-extension-button', buttonPadding: 'small', buttonVariant: 'primary', buttonClassName: 'qr-code-button', onClick: () => window.open(desktopUri), copykey: 'dyn_qr_code.open_button', typographyProps: { variant: 'button_secondary' }, startSlot:
|
|
92
|
+
// eslint-disable-next-line react/jsx-wrap-multilines
|
|
93
|
+
jsxRuntime.jsx(Icon.Icon, { size: 'xsmall', color: 'text-tertiary', children: jsxRuntime.jsx(externalLink.ReactComponent, {}) }), children: t('dyn_qr_code.open_button') }));
|
|
94
|
+
}
|
|
95
|
+
return (jsxRuntime.jsx(Button.Button, { expanded: true, dataTestId: 'get-extension-button', buttonPadding: 'small', buttonVariant: 'primary', buttonClassName: 'qr-code-button', onClick: () => setView('no-qr-not-installed'), copykey: 'dyn_qr_code.get_extension_button', typographyProps: { variant: 'button_secondary' }, startSlot:
|
|
96
|
+
// eslint-disable-next-line react/jsx-wrap-multilines
|
|
97
|
+
jsxRuntime.jsx(Icon.Icon, { size: 'xsmall', color: 'text-tertiary', children: jsxRuntime.jsx(externalLink.ReactComponent, {}) }), children: t('dyn_qr_code.get_extension_button') }));
|
|
98
|
+
};
|
|
85
99
|
return (jsxRuntime.jsxs("div", { className: classNames.classNames('qrcode-container__container', {
|
|
86
100
|
'qrcode-container__container--message': showQrCodeMessage,
|
|
87
|
-
}), children: [jsxRuntime.jsxs("div", { className: 'qrcode-container__top', children: [qrcodeValue
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
// rendering of this component, without this there is a brief flash
|
|
91
|
-
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, {}) }), Boolean(walletConnector) &&
|
|
92
|
-
t('dyn_qr_code.open_button', {
|
|
93
|
-
wallet: walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.name,
|
|
94
|
-
})] }))] }))] }), 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', {
|
|
101
|
+
}), children: [jsxRuntime.jsxs("div", { className: 'qrcode-container__top', children: [qrcodeValue && (jsxRuntime.jsx(QRCode.QRCode, { Icon: MainIcon, accentColor: accentColor, value: qrcodeValue, logoSize: 50, walletKey: walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.key, showQrCodeImage: showQrCodeImage })), jsxRuntime.jsx(MockedQrCode.MockedQrCode, {}), jsxRuntime.jsxs("div", { className: 'button-container', children: [showCopyToClipboardButton && qrcodeValue && (jsxRuntime.jsx(CopyButton.CopyButton, { variant: 'button', textToCopy: qrcodeValue, buttonClassName: 'qr-code-button', copykey: 'dyn_qr_code.copy_button', startSlot:
|
|
102
|
+
// eslint-disable-next-line react/jsx-wrap-multilines
|
|
103
|
+
jsxRuntime.jsx(Icon.Icon, { size: 'mini', color: 'text-tertiary', children: jsxRuntime.jsx(link.ReactComponent, {}) }), children: t('dyn_qr_code.copy_button') })), renderAppOrExtensionButton()] })] }), 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', {
|
|
95
104
|
app: walletConnector ? 'wallet' : 'app',
|
|
96
105
|
}) })] }));
|
|
97
106
|
};
|
|
@@ -5,7 +5,7 @@ import '@dynamic-labs/sdk-api';
|
|
|
5
5
|
import '../../../shared/logger.js';
|
|
6
6
|
import '@dynamic-labs/iconic';
|
|
7
7
|
import '@dynamic-labs/wallet-connector-core';
|
|
8
|
-
import '../../../context/ViewContext/ViewContext.js';
|
|
8
|
+
import { useViewContext } from '../../../context/ViewContext/ViewContext.js';
|
|
9
9
|
import 'react';
|
|
10
10
|
import { ReactComponent as SvgExternalLink } from '../../../shared/assets/externalLink.js';
|
|
11
11
|
import { ReactComponent as SvgLink } from '../../../shared/assets/link.js';
|
|
@@ -58,6 +58,7 @@ import '../../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
|
|
|
58
58
|
import '../../IconButton/IconButton.js';
|
|
59
59
|
import '../../MenuList/Dropdown/Dropdown.js';
|
|
60
60
|
import 'formik';
|
|
61
|
+
import { Button } from '../../Button/Button.js';
|
|
61
62
|
import '../../../views/TransactionConfirmationView/helpers/transactionErrorMessage.js';
|
|
62
63
|
import '../../Alert/Alert.js';
|
|
63
64
|
import '../../Input/Input.js';
|
|
@@ -67,7 +68,6 @@ import '../../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCar
|
|
|
67
68
|
import { CopyButton } from '../../CopyButton/CopyButton.js';
|
|
68
69
|
import '../../InlineWidget/InlineWidget.js';
|
|
69
70
|
import '../../IsBrowser/IsBrowser.js';
|
|
70
|
-
import { TextButton } from '../../TextButton/TextButton.js';
|
|
71
71
|
import '../../Popper/Popper/Popper.js';
|
|
72
72
|
import '../../Popper/PopperContext/PopperContext.js';
|
|
73
73
|
import { QRCode } from '../../QRCode/QRCode.js';
|
|
@@ -78,16 +78,25 @@ import '../../../views/LoginView/sections/PhoneNumberSignInSection/PhoneNumberSi
|
|
|
78
78
|
|
|
79
79
|
const QrCodeContainer = ({ accentColor, walletConnector, qrcodeValue, Icon: MainIcon, showCopyToClipboardButton = false, desktopUri, showQrCodeMessage, showQrCodeImage, }) => {
|
|
80
80
|
const { t } = useTranslation();
|
|
81
|
+
const { setView } = useViewContext();
|
|
82
|
+
const renderAppOrExtensionButton = () => {
|
|
83
|
+
if ((walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.key) === 'walletconnect') {
|
|
84
|
+
return null;
|
|
85
|
+
}
|
|
86
|
+
if (desktopUri) {
|
|
87
|
+
return (jsx(Button, { expanded: true, dataTestId: 'get-extension-button', buttonPadding: 'small', buttonVariant: 'primary', buttonClassName: 'qr-code-button', onClick: () => window.open(desktopUri), copykey: 'dyn_qr_code.open_button', typographyProps: { variant: 'button_secondary' }, startSlot:
|
|
88
|
+
// eslint-disable-next-line react/jsx-wrap-multilines
|
|
89
|
+
jsx(Icon, { size: 'xsmall', color: 'text-tertiary', children: jsx(SvgExternalLink, {}) }), children: t('dyn_qr_code.open_button') }));
|
|
90
|
+
}
|
|
91
|
+
return (jsx(Button, { expanded: true, dataTestId: 'get-extension-button', buttonPadding: 'small', buttonVariant: 'primary', buttonClassName: 'qr-code-button', onClick: () => setView('no-qr-not-installed'), copykey: 'dyn_qr_code.get_extension_button', typographyProps: { variant: 'button_secondary' }, startSlot:
|
|
92
|
+
// eslint-disable-next-line react/jsx-wrap-multilines
|
|
93
|
+
jsx(Icon, { size: 'xsmall', color: 'text-tertiary', children: jsx(SvgExternalLink, {}) }), children: t('dyn_qr_code.get_extension_button') }));
|
|
94
|
+
};
|
|
81
95
|
return (jsxs("div", { className: classNames('qrcode-container__container', {
|
|
82
96
|
'qrcode-container__container--message': showQrCodeMessage,
|
|
83
|
-
}), children: [jsxs("div", { className: 'qrcode-container__top', children: [qrcodeValue
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
// rendering of this component, without this there is a brief flash
|
|
87
|
-
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, {}) }), Boolean(walletConnector) &&
|
|
88
|
-
t('dyn_qr_code.open_button', {
|
|
89
|
-
wallet: walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.name,
|
|
90
|
-
})] }))] }))] }), 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', {
|
|
97
|
+
}), children: [jsxs("div", { className: 'qrcode-container__top', children: [qrcodeValue && (jsx(QRCode, { Icon: MainIcon, accentColor: accentColor, value: qrcodeValue, logoSize: 50, walletKey: walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.key, showQrCodeImage: showQrCodeImage })), jsx(MockedQrCode, {}), jsxs("div", { className: 'button-container', children: [showCopyToClipboardButton && qrcodeValue && (jsx(CopyButton, { variant: 'button', textToCopy: qrcodeValue, buttonClassName: 'qr-code-button', copykey: 'dyn_qr_code.copy_button', startSlot:
|
|
98
|
+
// eslint-disable-next-line react/jsx-wrap-multilines
|
|
99
|
+
jsx(Icon, { size: 'mini', color: 'text-tertiary', children: jsx(SvgLink, {}) }), children: t('dyn_qr_code.copy_button') })), renderAppOrExtensionButton()] })] }), 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', {
|
|
91
100
|
app: walletConnector ? 'wallet' : 'app',
|
|
92
101
|
}) })] }));
|
|
93
102
|
};
|
|
@@ -22,6 +22,7 @@ require('../../../utils/constants/colors.cjs');
|
|
|
22
22
|
require('../../../utils/constants/values.cjs');
|
|
23
23
|
require('../../../shared/utils/classes/storage/localStorage.cjs');
|
|
24
24
|
require('../../../shared/consts/index.cjs');
|
|
25
|
+
var useInternalDynamicContext = require('../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.cjs');
|
|
25
26
|
require('../../../context/CaptchaContext/CaptchaContext.cjs');
|
|
26
27
|
var ErrorContext = require('../../../context/ErrorContext/ErrorContext.cjs');
|
|
27
28
|
require('@dynamic-labs/multi-wallet');
|
|
@@ -84,7 +85,8 @@ require('../../../views/LoginView/sections/PhoneNumberSignInSection/PhoneNumberS
|
|
|
84
85
|
const Header = ({ onClose: handleClose, heading, projectSettings, copykey, }) => {
|
|
85
86
|
const { setError } = ErrorContext.useErrorContext();
|
|
86
87
|
const { isFooterExpanded, setIsFooterExpanded } = index.useFooterAnimationContext();
|
|
87
|
-
const {
|
|
88
|
+
const { selectedWalletConnector } = useInternalDynamicContext.useInternalDynamicContext();
|
|
89
|
+
const { goToInitialView, view, setView } = ViewContext.useViewContext();
|
|
88
90
|
const { showBackButton, showCloseButton, showHelpContent, isWalletListTypeView, displayBorderBelowHeader, } = useAuthLayoutChecks.useAuthLayoutChecks();
|
|
89
91
|
const { setExistentAccountData } = AccountExistsContext.useAccountExistsContext();
|
|
90
92
|
const { setSocialProvider } = SocialRedirectContext.useSocialRedirectContext();
|
|
@@ -93,15 +95,22 @@ const Header = ({ onClose: handleClose, heading, projectSettings, copykey, }) =>
|
|
|
93
95
|
setSocialProvider(undefined);
|
|
94
96
|
dynamicEvents.dynamicEvents.emit('farcasterConnectCancelled');
|
|
95
97
|
}
|
|
96
|
-
goToInitialView();
|
|
97
98
|
setExistentAccountData(undefined);
|
|
98
99
|
setError(undefined);
|
|
100
|
+
if (view.type === 'no-qr-not-installed' &&
|
|
101
|
+
(selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.canConnectViaQrCode)) {
|
|
102
|
+
setView('qr-code');
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
goToInitialView();
|
|
99
106
|
}, [
|
|
100
107
|
view.type,
|
|
101
108
|
goToInitialView,
|
|
102
109
|
setExistentAccountData,
|
|
103
110
|
setError,
|
|
104
111
|
setSocialProvider,
|
|
112
|
+
setView,
|
|
113
|
+
selectedWalletConnector,
|
|
105
114
|
]);
|
|
106
115
|
const closeButton = showCloseButton && handleClose && (jsxRuntime.jsx(IconButton.IconButton, { onClick: handleClose, type: 'button', id: 'close-button', "data-testid": 'close-button', className: 'header__icon', children: jsxRuntime.jsx(close.ReactComponent, {}) }));
|
|
107
116
|
const infoButton = showHelpContent && (jsxRuntime.jsx(Tooltip.Tooltip, { content: 'Need some help?', className: 'header__tooltip', children: jsxRuntime.jsx(IconButton.IconButton, { type: 'button', onClick: () => setIsFooterExpanded(!isFooterExpanded), "data-testid": 'info-button', className: 'header__icon', children: isWalletListTypeView ? jsxRuntime.jsx(questionMark.ReactComponent, {}) : jsxRuntime.jsx(footerInfoIcon.ReactComponent, {}) }) }, 'info-button'));
|
|
@@ -18,6 +18,7 @@ import '../../../utils/constants/colors.js';
|
|
|
18
18
|
import '../../../utils/constants/values.js';
|
|
19
19
|
import '../../../shared/utils/classes/storage/localStorage.js';
|
|
20
20
|
import '../../../shared/consts/index.js';
|
|
21
|
+
import { useInternalDynamicContext } from '../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.js';
|
|
21
22
|
import '../../../context/CaptchaContext/CaptchaContext.js';
|
|
22
23
|
import { useErrorContext } from '../../../context/ErrorContext/ErrorContext.js';
|
|
23
24
|
import '@dynamic-labs/multi-wallet';
|
|
@@ -80,7 +81,8 @@ import '../../../views/LoginView/sections/PhoneNumberSignInSection/PhoneNumberSi
|
|
|
80
81
|
const Header = ({ onClose: handleClose, heading, projectSettings, copykey, }) => {
|
|
81
82
|
const { setError } = useErrorContext();
|
|
82
83
|
const { isFooterExpanded, setIsFooterExpanded } = useFooterAnimationContext();
|
|
83
|
-
const {
|
|
84
|
+
const { selectedWalletConnector } = useInternalDynamicContext();
|
|
85
|
+
const { goToInitialView, view, setView } = useViewContext();
|
|
84
86
|
const { showBackButton, showCloseButton, showHelpContent, isWalletListTypeView, displayBorderBelowHeader, } = useAuthLayoutChecks();
|
|
85
87
|
const { setExistentAccountData } = useAccountExistsContext();
|
|
86
88
|
const { setSocialProvider } = useSocialRedirectContext();
|
|
@@ -89,15 +91,22 @@ const Header = ({ onClose: handleClose, heading, projectSettings, copykey, }) =>
|
|
|
89
91
|
setSocialProvider(undefined);
|
|
90
92
|
dynamicEvents.emit('farcasterConnectCancelled');
|
|
91
93
|
}
|
|
92
|
-
goToInitialView();
|
|
93
94
|
setExistentAccountData(undefined);
|
|
94
95
|
setError(undefined);
|
|
96
|
+
if (view.type === 'no-qr-not-installed' &&
|
|
97
|
+
(selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.canConnectViaQrCode)) {
|
|
98
|
+
setView('qr-code');
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
goToInitialView();
|
|
95
102
|
}, [
|
|
96
103
|
view.type,
|
|
97
104
|
goToInitialView,
|
|
98
105
|
setExistentAccountData,
|
|
99
106
|
setError,
|
|
100
107
|
setSocialProvider,
|
|
108
|
+
setView,
|
|
109
|
+
selectedWalletConnector,
|
|
101
110
|
]);
|
|
102
111
|
const closeButton = showCloseButton && handleClose && (jsx(IconButton, { onClick: handleClose, type: 'button', id: 'close-button', "data-testid": 'close-button', className: 'header__icon', children: jsx(SvgClose, {}) }));
|
|
103
112
|
const infoButton = showHelpContent && (jsx(Tooltip, { content: 'Need some help?', className: 'header__tooltip', children: jsx(IconButton, { type: 'button', onClick: () => setIsFooterExpanded(!isFooterExpanded), "data-testid": 'info-button', className: 'header__icon', children: isWalletListTypeView ? jsx(SvgQuestionMark, {}) : jsx(SvgFooterInfoIcon, {}) }) }, 'info-button'));
|
|
@@ -621,6 +621,7 @@ const translation = {
|
|
|
621
621
|
phone_number_form: {
|
|
622
622
|
invalid_phone: 'Invalid or incorrect number. Did you mistype it?',
|
|
623
623
|
invalid_sms_verification: 'The code you entered is incorrect. Please try again.',
|
|
624
|
+
too_many_sms_verification_attempts: 'Too many verification attempts, please try again later.',
|
|
624
625
|
},
|
|
625
626
|
pending_connect: {
|
|
626
627
|
title: 'Connecting a wallet',
|
|
@@ -1098,7 +1099,8 @@ const translation = {
|
|
|
1098
1099
|
* @default
|
|
1099
1100
|
* {
|
|
1100
1101
|
copy_button: 'Copy QR URI',
|
|
1101
|
-
|
|
1102
|
+
get_extension_button: 'Get extension',
|
|
1103
|
+
open_button: 'Open App',
|
|
1102
1104
|
scan_title: "Scan this QR code from your mobile {{app}} or phone's camera to connect.",
|
|
1103
1105
|
wallet_not_installed: {
|
|
1104
1106
|
browser_install: 'Install {{browser}} extension',
|
|
@@ -1110,7 +1112,8 @@ const translation = {
|
|
|
1110
1112
|
*/
|
|
1111
1113
|
dyn_qr_code: {
|
|
1112
1114
|
copy_button: 'Copy QR URI',
|
|
1113
|
-
|
|
1115
|
+
get_extension_button: 'Get Extension',
|
|
1116
|
+
open_button: 'Open App',
|
|
1114
1117
|
scan_title: "Scan this QR code from your mobile {{app}} or phone's camera to connect.",
|
|
1115
1118
|
wallet_not_installed: {
|
|
1116
1119
|
browser_install: 'Install {{browser}} extension',
|
|
@@ -1401,14 +1404,14 @@ const translation = {
|
|
|
1401
1404
|
* @description copy keys for Select Chain view
|
|
1402
1405
|
* @default
|
|
1403
1406
|
* {
|
|
1404
|
-
title: "
|
|
1407
|
+
title: "Connect",
|
|
1405
1408
|
description:
|
|
1406
1409
|
"This wallet supports using ledger. Toggle on ledger to enable it.",
|
|
1407
1410
|
using_hardware_wallet_toggle_label: "Using Ledger with {{chainName}}",
|
|
1408
1411
|
}
|
|
1409
1412
|
*/
|
|
1410
1413
|
dyn_select_hardware_wallet: {
|
|
1411
|
-
title: '
|
|
1414
|
+
title: 'Connect',
|
|
1412
1415
|
description: 'This wallet supports using ledger. Toggle on ledger to enable it.',
|
|
1413
1416
|
using_hardware_wallet_toggle_label: 'Using Ledger with {{chainName}}',
|
|
1414
1417
|
},
|
|
@@ -616,6 +616,7 @@ export declare const translation: {
|
|
|
616
616
|
phone_number_form: {
|
|
617
617
|
invalid_phone: string;
|
|
618
618
|
invalid_sms_verification: string;
|
|
619
|
+
too_many_sms_verification_attempts: string;
|
|
619
620
|
};
|
|
620
621
|
pending_connect: {
|
|
621
622
|
title: string;
|
|
@@ -1093,7 +1094,8 @@ export declare const translation: {
|
|
|
1093
1094
|
* @default
|
|
1094
1095
|
* {
|
|
1095
1096
|
copy_button: 'Copy QR URI',
|
|
1096
|
-
|
|
1097
|
+
get_extension_button: 'Get extension',
|
|
1098
|
+
open_button: 'Open App',
|
|
1097
1099
|
scan_title: "Scan this QR code from your mobile {{app}} or phone's camera to connect.",
|
|
1098
1100
|
wallet_not_installed: {
|
|
1099
1101
|
browser_install: 'Install {{browser}} extension',
|
|
@@ -1105,6 +1107,7 @@ export declare const translation: {
|
|
|
1105
1107
|
*/
|
|
1106
1108
|
dyn_qr_code: {
|
|
1107
1109
|
copy_button: string;
|
|
1110
|
+
get_extension_button: string;
|
|
1108
1111
|
open_button: string;
|
|
1109
1112
|
scan_title: string;
|
|
1110
1113
|
wallet_not_installed: {
|
|
@@ -1396,7 +1399,7 @@ export declare const translation: {
|
|
|
1396
1399
|
* @description copy keys for Select Chain view
|
|
1397
1400
|
* @default
|
|
1398
1401
|
* {
|
|
1399
|
-
title: "
|
|
1402
|
+
title: "Connect",
|
|
1400
1403
|
description:
|
|
1401
1404
|
"This wallet supports using ledger. Toggle on ledger to enable it.",
|
|
1402
1405
|
using_hardware_wallet_toggle_label: "Using Ledger with {{chainName}}",
|
|
@@ -617,6 +617,7 @@ const translation = {
|
|
|
617
617
|
phone_number_form: {
|
|
618
618
|
invalid_phone: 'Invalid or incorrect number. Did you mistype it?',
|
|
619
619
|
invalid_sms_verification: 'The code you entered is incorrect. Please try again.',
|
|
620
|
+
too_many_sms_verification_attempts: 'Too many verification attempts, please try again later.',
|
|
620
621
|
},
|
|
621
622
|
pending_connect: {
|
|
622
623
|
title: 'Connecting a wallet',
|
|
@@ -1094,7 +1095,8 @@ const translation = {
|
|
|
1094
1095
|
* @default
|
|
1095
1096
|
* {
|
|
1096
1097
|
copy_button: 'Copy QR URI',
|
|
1097
|
-
|
|
1098
|
+
get_extension_button: 'Get extension',
|
|
1099
|
+
open_button: 'Open App',
|
|
1098
1100
|
scan_title: "Scan this QR code from your mobile {{app}} or phone's camera to connect.",
|
|
1099
1101
|
wallet_not_installed: {
|
|
1100
1102
|
browser_install: 'Install {{browser}} extension',
|
|
@@ -1106,7 +1108,8 @@ const translation = {
|
|
|
1106
1108
|
*/
|
|
1107
1109
|
dyn_qr_code: {
|
|
1108
1110
|
copy_button: 'Copy QR URI',
|
|
1109
|
-
|
|
1111
|
+
get_extension_button: 'Get Extension',
|
|
1112
|
+
open_button: 'Open App',
|
|
1110
1113
|
scan_title: "Scan this QR code from your mobile {{app}} or phone's camera to connect.",
|
|
1111
1114
|
wallet_not_installed: {
|
|
1112
1115
|
browser_install: 'Install {{browser}} extension',
|
|
@@ -1397,14 +1400,14 @@ const translation = {
|
|
|
1397
1400
|
* @description copy keys for Select Chain view
|
|
1398
1401
|
* @default
|
|
1399
1402
|
* {
|
|
1400
|
-
title: "
|
|
1403
|
+
title: "Connect",
|
|
1401
1404
|
description:
|
|
1402
1405
|
"This wallet supports using ledger. Toggle on ledger to enable it.",
|
|
1403
1406
|
using_hardware_wallet_toggle_label: "Using Ledger with {{chainName}}",
|
|
1404
1407
|
}
|
|
1405
1408
|
*/
|
|
1406
1409
|
dyn_select_hardware_wallet: {
|
|
1407
|
-
title: '
|
|
1410
|
+
title: 'Connect',
|
|
1408
1411
|
description: 'This wallet supports using ledger. Toggle on ledger to enable it.',
|
|
1409
1412
|
using_hardware_wallet_toggle_label: 'Using Ledger with {{chainName}}',
|
|
1410
1413
|
},
|