-
Notifications
You must be signed in to change notification settings - Fork 149
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: add components group and format components directory (#37)
* refactor: format component directory * refactor: Address -> address * docs: init components group --------- Co-authored-by: yutingzhao1991 <[email protected]>
- Loading branch information
1 parent
bb9bb83
commit 647fa91
Showing
53 changed files
with
132 additions
and
49 deletions.
There are no files selected for viewing
Empty file.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { Address } from '@ant-design/web3'; | ||
|
||
export default () => { | ||
return <Address ellipsis address={'3ea2cfd153b8d8505097b81c87c11f5d05097c18'} />; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
nav: Components | ||
group: Components | ||
--- | ||
|
||
# Address | ||
|
||
## Simple Usage | ||
|
||
<code src="./demos/simple.tsx"></code> |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
nav: 组件 | ||
group: 组件 | ||
--- | ||
|
||
# Address | ||
|
||
## 基本使用 | ||
|
||
<code src="./demos/simple.tsx"></code> |
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions
4
packages/web3/src/BrowserLink/index.md → packages/web3/src/browser-link/index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
--- | ||
group: | ||
title: Components | ||
nav: Components | ||
group: Components | ||
--- | ||
|
||
# BrowserLink | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
packages/web3/src/BrowserLink/index.zh-CN.md → ...ages/web3/src/browser-link/index.zh-CN.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
--- | ||
group: | ||
title: 组件 | ||
nav: 组件 | ||
group: 组件 | ||
--- | ||
|
||
# BrowerLink | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
--- | ||
group: | ||
title: Components | ||
nav: Components | ||
group: Components | ||
--- | ||
|
||
# ConnectButton | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
--- | ||
group: | ||
title: 组件 | ||
nav: 组件 | ||
group: 组件 | ||
--- | ||
|
||
# ConnectButton | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions
4
packages/web3/src/ConnectModal/index.md → packages/web3/src/connect-modal/index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
--- | ||
group: | ||
title: Components | ||
nav: Components | ||
group: Components | ||
--- | ||
|
||
# ConnectModal | ||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { useNFT } from '@ant-design/web3'; | ||
|
||
export default () => { | ||
const { metadata } = useNFT('0x79fcdef22feed20eddacbb2587640e45491b757f', 42); | ||
return <div>{metadata.name}</div>; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
nav: Components | ||
group: General | ||
--- | ||
|
||
# Hooks | ||
|
||
Components used to display NFT images more conveniently and simply. | ||
|
||
## useNFT | ||
|
||
<code src="./demos/useNFT.tsx"></code> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default as useNFT } from './useNFT'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
nav: 组件 | ||
group: 通用 | ||
--- | ||
|
||
# Hooks | ||
|
||
## useNFT | ||
|
||
<code src="./demos/useNFT.tsx"></code> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
nav: Components | ||
group: General | ||
--- | ||
|
||
# Icons | ||
|
||
```jsx | ||
import { ArbitrumFilled } from '@ant-design/web3-icons'; | ||
|
||
export default () => { | ||
return <ArbitrumFilled />; | ||
}; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
nav: 组件 | ||
group: 通用 | ||
--- | ||
|
||
# Icons | ||
|
||
```jsx | ||
import { ArbitrumFilled } from '@ant-design/web3-icons'; | ||
|
||
export default () => { | ||
return <ArbitrumFilled />; | ||
}; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
export * from './connect-button'; | ||
export * from './ConnectModal'; | ||
export * from './MockProvider'; | ||
export * from './Address'; | ||
export * from './BrowserLink'; | ||
export * from './NFTCard'; | ||
export * from './connect-modal'; | ||
export * from './mock-provider'; | ||
export * from './address'; | ||
export * from './browser-link'; | ||
export * from './nft-image'; | ||
export * from './constants'; | ||
export * from './hooks'; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { NFTImage } from '@ant-design/web3'; | ||
|
||
export default () => { | ||
return <NFTImage address="0x79fcdef22feed20eddacbb2587640e45491b757f" tokenId={42} />; | ||
}; |
6 changes: 3 additions & 3 deletions
6
packages/web3/src/NFTCard/index.md → packages/web3/src/nft-image/index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import React from 'react'; | ||
import { Image, ImageProps } from 'antd'; | ||
import { getWeb3AssetUrl } from '@ant-design/web3-common'; | ||
import useNFT from '../hooks/useNFT'; | ||
|
||
export interface NFTCardProps extends ImageProps { | ||
address: string; | ||
tokenId: number; | ||
} | ||
|
||
export const NFTImage: React.FC<NFTCardProps> = ({ address, tokenId, ...rest }) => { | ||
const { metadata } = useNFT(address, tokenId); | ||
|
||
return <Image src={getWeb3AssetUrl(metadata.image)} {...rest} />; | ||
}; |
6 changes: 3 additions & 3 deletions
6
packages/web3/src/NFTCard/index.zh-CN.md → packages/web3/src/nft-image/index.zh-CN.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
--- | ||
group: | ||
title: Components | ||
nav: 组件 | ||
group: 组件 | ||
--- | ||
|
||
# NFTCard | ||
# NFTImage | ||
|
||
更简单地展示 NFT 图片的组件。 | ||
|
||
|