Skip to content

Commit

Permalink
fix: add translate
Browse files Browse the repository at this point in the history
  • Loading branch information
Likang0122 committed Dec 5, 2024
1 parent 61e9878 commit 50511eb
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions docs/guide/demos/best-practice/components/pay-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ export const EvmPayButtons: React.FC<PayButtonsProps> = ({
),
}}
>
<ConnectButton showChainSelect={false} />
<ConnectButton chainSelect={false} />
</Connector>
<EvmSignTransaction
setTokenEcosystem={setTokenEcosystem}
tokenEcosystem={tokenEcosystem}
signTransactionCallback={(signTransfer, address) => {
signTransaction={(signTransfer, address) => {
payCallback(signTransfer, address);
}}
onRejectSwitchChain={onRejectSwitchChain}
Expand Down
6 changes: 3 additions & 3 deletions docs/guide/demos/best-practice/components/send.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -21,7 +21,7 @@ type SignTransactionProps = {
const EvmSignTransaction: React.FC<SignTransactionProps> = ({
setTokenEcosystem,
tokenEcosystem,
signTransactionCallback,
signTransaction,
renderSignButton,
onRejectSwitchChain,
}) => {
Expand Down Expand Up @@ -94,7 +94,7 @@ const EvmSignTransaction: React.FC<SignTransactionProps> = ({
],
});
setSignLoading(false);
signTransactionCallback?.(signTransferHash, account?.address || '');
signTransaction?.(signTransferHash, account?.address || '');
} catch (error) {
console.log('error', (error as any).message);
setSignLoading(false);
Expand Down
6 changes: 3 additions & 3 deletions docs/guide/payment-in-usdt.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

<code compact src="./demos/best-practice/usdt.tsx"></code>
8 changes: 4 additions & 4 deletions packages/web3/src/connect-button/connect-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { ConnectButtonTooltip } from './tooltip';

export const ConnectButton: React.FC<ConnectButtonProps> = (props) => {
const {
showChainSelect = true,
chainSelect = true,
onConnectClick,
onDisconnectClick,
availableChains,
Expand Down Expand Up @@ -125,8 +125,8 @@ export const ConnectButton: React.FC<ConnectButtonProps> = (props) => {
size: props.size,
};

const chainSelect =
showChainSelect && availableChains && availableChains.length > 1 ? (
const chainSelectRender =
chainSelect && availableChains && availableChains.length > 1 ? (
<ChainSelect {...chainProps} />
) : null;

Expand All @@ -150,7 +150,7 @@ export const ConnectButton: React.FC<ConnectButtonProps> = (props) => {
<ConnectButtonInner
intl={intl}
{...buttonProps}
preContent={chainSelect}
preContent={chainSelectRender}
showQuickConnect={quickConnect && !account}
availableWallets={availableWallets}
onConnectClick={(wallet?: Wallet) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/web3/src/connect-button/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 50511eb

Please sign in to comment.