Skip to content

Commit

Permalink
fix: qr code scan tip text for universal protocol (#677)
Browse files Browse the repository at this point in the history
Co-authored-by: tingzhao.ytz <tingzhao.ytz@antgroup.com>
  • Loading branch information
yutingzhao1991 and tingzhao.ytz committed Mar 22, 2024
1 parent 554cb41 commit 6f4c55f
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .changeset/smooth-trees-stare.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@ant-design/web3-common': patch
'@ant-design/web3': patch
---

fix: qr code scan tip text for universal protocol
1 change: 1 addition & 0 deletions packages/common/src/locale/en_US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const localeValues: RequiredLocale = {
'Select a wallet on the left to get started with a different wallet provider.',
qrCodePanelTitleForDownload: 'Download {walletName}',
qrCodePanelTitleForScan: 'Scan with {walletName}',
qrCodePanelTitleForUniversalProtocol: 'Scan with your wallet',
qrCodePanelLinkForDownload: 'Click to go to the download page',
qrCodePanelLinkForConnect: 'Click to connect directly',
qrCodePanelDownloadTipForReady: 'Scan the QR code to download the wallet.',
Expand Down
1 change: 1 addition & 0 deletions packages/common/src/locale/zh_CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const localeValues: RequiredLocale = {
getWalletPanelInfoDesc: '在左侧选择钱包,以开始使用不同的钱包提供商。',
qrCodePanelTitleForDownload: '下载 {walletName}',
qrCodePanelTitleForScan: '使用 {walletName} 扫描',
qrCodePanelTitleForUniversalProtocol: '使用你的钱包扫描',
qrCodePanelLinkForDownload: '点击前往下载页面',
qrCodePanelLinkForConnect: '点击直接连接',
qrCodePanelDownloadTipForReady: '扫描二维码下载钱包',
Expand Down
1 change: 1 addition & 0 deletions packages/common/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ export interface RequiredLocale {
getWalletPanelInfoDesc: string;
qrCodePanelTitleForDownload: string;
qrCodePanelTitleForScan: string;
qrCodePanelTitleForUniversalProtocol: string;
qrCodePanelLinkForDownload: string;
qrCodePanelLinkForConnect: string;
qrCodePanelDownloadTipForReady: string;
Expand Down
4 changes: 3 additions & 1 deletion packages/web3/src/connect-modal/components/QrCode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ const QrCode: React.FC<QrCodeProps> = (props) => {
title={getMessage(
download
? localeMessage.qrCodePanelTitleForDownload
: localeMessage.qrCodePanelTitleForScan,
: wallet.universalProtocol
? localeMessage.qrCodePanelTitleForUniversalProtocol
: localeMessage.qrCodePanelTitleForScan,
{
walletName: wallet.name,
},
Expand Down
6 changes: 6 additions & 0 deletions packages/web3/src/connector/__tests__/quick-connect.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,12 @@ describe('Connector quick connect', () => {
expect(baseElement.querySelector('.ant-btn-loading-icon')).toBeTruthy();
expect(baseElement.querySelector('.ant-modal-body')).toBeTruthy();
expect(baseElement.querySelector('.ant-web3-connect-modal-qr-code')).toBeTruthy();
expect(baseElement.querySelector('.ant-web3-connect-modal-get-wallet-tip')?.textContent).toBe(
"Don't know WalletConnect?",
);
expect(
baseElement.querySelector('.ant-web3-connect-modal-main-panel-header-title')?.textContent,
).toBe('Scan with your wallet');
});
});

Expand Down

0 comments on commit 6f4c55f

Please sign in to comment.