From 5a6a64a399e32567ac5a653fea98f39d03e7fa67 Mon Sep 17 00:00:00 2001 From: Likang0122 Date: Thu, 5 Dec 2024 14:31:18 +0800 Subject: [PATCH] fix: add translate --- docs/guide/demos/best-practice/components/pay-button.tsx | 4 ++-- docs/guide/demos/best-practice/components/send.tsx | 6 +++--- docs/guide/payment-in-usdt.md | 6 +++--- packages/web3/src/connect-button/connect-button.tsx | 8 ++++---- packages/web3/src/connect-button/interface.ts | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/docs/guide/demos/best-practice/components/pay-button.tsx b/docs/guide/demos/best-practice/components/pay-button.tsx index 27503e092..d6685814a 100644 --- a/docs/guide/demos/best-practice/components/pay-button.tsx +++ b/docs/guide/demos/best-practice/components/pay-button.tsx @@ -62,12 +62,12 @@ export const EvmPayButtons: React.FC = ({ ), }} > - + { + signTransaction={(signTransfer, address) => { payCallback(signTransfer, address); }} onRejectSwitchChain={onRejectSwitchChain} diff --git a/docs/guide/demos/best-practice/components/send.tsx b/docs/guide/demos/best-practice/components/send.tsx index 2f65b78b1..b8f87dda1 100644 --- a/docs/guide/demos/best-practice/components/send.tsx +++ b/docs/guide/demos/best-practice/components/send.tsx @@ -9,7 +9,7 @@ import { TOKEN_PAY_ADDRESS } from '../constants/tokenPayAddress'; type SignTransactionProps = { setTokenEcosystem?: (token: string) => void; tokenEcosystem: string; - signTransactionCallback?: (signTransfer: string, address: string) => void; + signTransaction: (signTransfer: string, address: string) => void; renderSignButton: ( signTransfer: (toAddress: string, amount: number) => void, disabled: boolean, @@ -21,7 +21,7 @@ type SignTransactionProps = { const EvmSignTransaction: React.FC = ({ setTokenEcosystem, tokenEcosystem, - signTransactionCallback, + signTransaction, renderSignButton, onRejectSwitchChain, }) => { @@ -94,7 +94,7 @@ const EvmSignTransaction: React.FC = ({ ], }); setSignLoading(false); - signTransactionCallback?.(signTransferHash, account?.address || ''); + signTransaction?.(signTransferHash, account?.address || ''); } catch (error) { console.log('error', (error as any).message); setSignLoading(false); diff --git a/docs/guide/payment-in-usdt.md b/docs/guide/payment-in-usdt.md index f75d85d84..b87095700 100644 --- a/docs/guide/payment-in-usdt.md +++ b/docs/guide/payment-in-usdt.md @@ -5,10 +5,10 @@ group: Best Practice # Payment In USDT -当你的项目需要支持 `USDT` 付款的时候,并且需要支持多个链的 `USDT` / `USDC` 时,下边这些可以帮到你。 +When your project needs to support `USDT` payments and needs to support `USDT/USDC` on multiple chains, the following can help you. -你可以通过我们官方提供的适配器配合 `@ant-design/web3` 使用,快速连接各类区块链,以便于同时支持这些链的 `USDT` / `USDC` 支付。 +You can use our official adapter with `@ant-design/web3` to quickly connect to various blockchains to support `USDT/USDC` payments on these chains at the same time. -你可以这样做: +You can do this: diff --git a/packages/web3/src/connect-button/connect-button.tsx b/packages/web3/src/connect-button/connect-button.tsx index bc2010723..85a3b9bd7 100644 --- a/packages/web3/src/connect-button/connect-button.tsx +++ b/packages/web3/src/connect-button/connect-button.tsx @@ -21,7 +21,7 @@ import { ConnectButtonTooltip } from './tooltip'; export const ConnectButton: React.FC = (props) => { const { - showChainSelect = true, + chainSelect = true, onConnectClick, onDisconnectClick, availableChains, @@ -125,8 +125,8 @@ export const ConnectButton: React.FC = (props) => { size: props.size, }; - const chainSelect = - showChainSelect && availableChains && availableChains.length > 1 ? ( + const chainSelectRender = + chainSelect && availableChains && availableChains.length > 1 ? ( ) : null; @@ -150,7 +150,7 @@ export const ConnectButton: React.FC = (props) => { { diff --git a/packages/web3/src/connect-button/interface.ts b/packages/web3/src/connect-button/interface.ts index abf10c24d..a1540682d 100644 --- a/packages/web3/src/connect-button/interface.ts +++ b/packages/web3/src/connect-button/interface.ts @@ -15,7 +15,7 @@ export type ConnectButtonTooltipProps = TooltipProps & { export type ConnectButtonProps = ButtonProps & ConnectorTriggerProps & { - showChainSelect?: boolean | true; + chainSelect?: boolean | true; prefixCls?: string; locale?: Locale['ConnectButton']; avatar?: AvatarProps;