Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: qr code scan tip text for universal protocol #677

Merged
merged 1 commit into from
Mar 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading