Skip to content

Commit

Permalink
docs: update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
kiner-tang committed Nov 26, 2023
1 parent 7608e99 commit e3f2164
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
11 changes: 10 additions & 1 deletion packages/web3/src/connect-button/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ A Button for connect chain quickly.
| address | Address | `string` | - | - |
| name | Name, like ENS | `string` | - | - |
| tooltip | Show tooltip when mouse enter address | `boolean \|` [ConnectButtonTooltipProps](#connectbuttontooltipprops) | `true`, will display address by default | - |
| menuItems | Show menu | [ItemType](https://ant-design.antgroup.com/components/menu-cn#itemtype) | - | - |
| menuItems | Menu items array, menu item can trigger built-in action by binding specific `key`, supported built-in action key: [BuildInMenuItemKey](#buildinmenuitemkey) | [ItemType](https://ant-design.antgroup.com/components/menu-cn#itemtype) | - | - |
| clickActionType | Action when click button, related to `connected` when set to `showProfileModal` | `showProfileModal \| showMenu` | `showProfileModal` | - |

### ConnectButtonTooltipProps
Expand All @@ -49,3 +49,12 @@ export type ConnectButtonTooltipProps = TooltipProps & {
title?: boolean | string | React.ReactNode; // Show content
};
```

### BuildInMenuItemKey

```ts
export enum BuildInMenuItemKey {
CopyAddress = 'copyAddress', // Copy address
Disconnect = 'disconnect', // Disconnect
}
```
11 changes: 10 additions & 1 deletion packages/web3/src/connect-button/index.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ group: 组件
| address | 地址 | `string` | - | - |
| name | 名称,比如以太坊的 ENS | `string` | - | - |
| tooltip | 鼠标移入地址时展示提示 | `boolean \|` [ConnectButtonTooltipProps](#connectbuttontooltipprops) | `true`,默认显示 address 信息 | - |
| menuItems | 展示菜单 | [ItemType](https://ant-design.antgroup.com/components/menu-cn#itemtype) | - | - |
| menuItems | 菜单项数组,菜单项可通过绑定特定的 `key` 触发内置行为,支持的内置行为 key : [BuildInMenuItemKey](#buildinmenuitemkey) | [ItemType](https://ant-design.antgroup.com/components/menu-cn#itemtype) | - | - |
| clickActionType | 点击按钮时的行为,当设置为 `showProfileModal` 时还与 `connected` 属性相关 | `showProfileModal \| showMenu` | `showProfileModal` | - |

### ConnectButtonTooltipProps
Expand All @@ -47,3 +47,12 @@ export type ConnectButtonTooltipProps = TooltipProps & {
title?: boolean | string | React.ReactNode; // 展示内容
};
```

### BuildInMenuItemKey

```ts
export enum BuildInMenuItemKey {
CopyAddress = 'copyAddress', // 复制地址
Disconnect = 'disconnect', // 断开连接
}
```

0 comments on commit e3f2164

Please sign in to comment.