Skip to content

Commit 6f4c55f

Browse files
yutingzhao1991tingzhao.ytz
andauthored
fix: qr code scan tip text for universal protocol (#677)
Co-authored-by: tingzhao.ytz <[email protected]>
1 parent 554cb41 commit 6f4c55f

File tree

6 files changed

+18
-1
lines changed

6 files changed

+18
-1
lines changed

.changeset/smooth-trees-stare.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@ant-design/web3-common': patch
3+
'@ant-design/web3': patch
4+
---
5+
6+
fix: qr code scan tip text for universal protocol

packages/common/src/locale/en_US.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ const localeValues: RequiredLocale = {
2929
'Select a wallet on the left to get started with a different wallet provider.',
3030
qrCodePanelTitleForDownload: 'Download {walletName}',
3131
qrCodePanelTitleForScan: 'Scan with {walletName}',
32+
qrCodePanelTitleForUniversalProtocol: 'Scan with your wallet',
3233
qrCodePanelLinkForDownload: 'Click to go to the download page',
3334
qrCodePanelLinkForConnect: 'Click to connect directly',
3435
qrCodePanelDownloadTipForReady: 'Scan the QR code to download the wallet.',

packages/common/src/locale/zh_CN.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ const localeValues: RequiredLocale = {
2727
getWalletPanelInfoDesc: '在左侧选择钱包,以开始使用不同的钱包提供商。',
2828
qrCodePanelTitleForDownload: '下载 {walletName}',
2929
qrCodePanelTitleForScan: '使用 {walletName} 扫描',
30+
qrCodePanelTitleForUniversalProtocol: '使用你的钱包扫描',
3031
qrCodePanelLinkForDownload: '点击前往下载页面',
3132
qrCodePanelLinkForConnect: '点击直接连接',
3233
qrCodePanelDownloadTipForReady: '扫描二维码下载钱包',

packages/common/src/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ export interface RequiredLocale {
217217
getWalletPanelInfoDesc: string;
218218
qrCodePanelTitleForDownload: string;
219219
qrCodePanelTitleForScan: string;
220+
qrCodePanelTitleForUniversalProtocol: string;
220221
qrCodePanelLinkForDownload: string;
221222
qrCodePanelLinkForConnect: string;
222223
qrCodePanelDownloadTipForReady: string;

packages/web3/src/connect-modal/components/QrCode.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ const QrCode: React.FC<QrCodeProps> = (props) => {
4848
title={getMessage(
4949
download
5050
? localeMessage.qrCodePanelTitleForDownload
51-
: localeMessage.qrCodePanelTitleForScan,
51+
: wallet.universalProtocol
52+
? localeMessage.qrCodePanelTitleForUniversalProtocol
53+
: localeMessage.qrCodePanelTitleForScan,
5254
{
5355
walletName: wallet.name,
5456
},

packages/web3/src/connector/__tests__/quick-connect.test.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,12 @@ describe('Connector quick connect', () => {
109109
expect(baseElement.querySelector('.ant-btn-loading-icon')).toBeTruthy();
110110
expect(baseElement.querySelector('.ant-modal-body')).toBeTruthy();
111111
expect(baseElement.querySelector('.ant-web3-connect-modal-qr-code')).toBeTruthy();
112+
expect(baseElement.querySelector('.ant-web3-connect-modal-get-wallet-tip')?.textContent).toBe(
113+
"Don't know WalletConnect?",
114+
);
115+
expect(
116+
baseElement.querySelector('.ant-web3-connect-modal-main-panel-header-title')?.textContent,
117+
).toBe('Scan with your wallet');
112118
});
113119
});
114120

0 commit comments

Comments
 (0)