Skip to content

Commit

Permalink
docs: add connect components desc (#169)
Browse files Browse the repository at this point in the history
Co-authored-by: yutingzhao1991 <[email protected]>
  • Loading branch information
yutingzhao1991 and yutingzhao1991 authored Dec 4, 2023
1 parent 5820708 commit ce8ae74
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/web3/src/connect-button/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ order: 1

# ConnectButton

A Button for connect chain quickly.
The button to connect to the blockchain wallet. Usually, you need to use it with the [Connector](../connector/index.md) component.

## Basic Usage

Expand Down
2 changes: 1 addition & 1 deletion packages/web3/src/connect-button/index.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ order: 1

# ConnectButton

快速和区块链建立连接
连接区块链钱包的按钮。通常来说,你需要配合 [Connector](../connector/index.zh-CN.md) 组件使用

## 基本使用

Expand Down
2 changes: 1 addition & 1 deletion packages/web3/src/connect-modal/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ order: 2

# ConnectModal

Connect wallet modal, used with ConnectButton to complete the wallet connection process.
The connection wallet popup, used with [ConnectButton](../connect-button) to complete the wallet connection process. Usually, you only need to use the [Connector](../connector) component directly.

## Basic Usage

Expand Down
2 changes: 1 addition & 1 deletion packages/web3/src/connect-modal/index.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ order: 2

# ConnectModal

连接钱包弹窗,与 ConnectButton 配合使用完成钱包的链接流程。
连接钱包弹窗,与 [ConnectButton](../connect-button/index.zh-CN.md) 配合使用完成钱包的链接流程。通常来说,你只要直接使用 [Connector](../connector/index.zh-CN.md) 组件即可

## 基本使用

Expand Down
6 changes: 6 additions & 0 deletions packages/web3/src/connector/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ order: 0

# Connector

The `Connector` component integrates the [ConnectButton](../connect-button/index.md) and [ConnectModal](../connect-modal/index.md) components to provide a complete UI for connecting wallets.

The properties related to blockchain interaction are configured through Connector and passed to `ConnectButton` and `ConnectModal`. You can also override the values provided by `Connector` by directly configuring the properties of `ConnectButton` or through `modalProps`, but in addition to some pure UI properties that are not related to the chain, you usually don’t need to do this.

In addition, `Connector` is usually used with [adapter](../../guide/adapter). The adapter can help you quickly interact with the blockchain. In the case of using the adapter, you basically don’t need to configure the properties of `Connector`.

## Basic Usage

<code src="./demos/basic.tsx"></code>
Expand Down
6 changes: 6 additions & 0 deletions packages/web3/src/connector/index.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ order: 0

# Connector

`Connector` 组件整合了 [ConnectButton](../connect-button/index.zh-CN.md)[ConnectModal](../connect-modal/index.zh-CN.md) 组件,提供了一个完整的连接钱包的功能的 UI。

和区块链交互相关的属性通过 Connector 配置后会传递给 `ConnectButton``ConnectModal`,你也可以通过直接配置 `ConnectButton` 的属性或者通过 `modalProps` 来覆盖 `Connector` 提供的值,但是除了部分和链无关的纯 UI 的属性外,你通常并不需要这么做。

另外,`Connector` 通常会配合[适配器](../../guide/adapter)使用,适配器可以帮助你快速和区块链交互,使用适配器的情况下你基本不需要配置 `Connector` 的属性。

## 基本使用

<code src="./demos/basic.tsx"></code>
Expand Down

0 comments on commit ce8ae74

Please sign in to comment.