Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: PayPanel component develop #876

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open

feat: PayPanel component develop #876

wants to merge 15 commits into from

Conversation

Likang0122
Copy link
Collaborator

No description provided.

Copy link

vercel bot commented May 14, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
ant-design-web3 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 4, 2024 2:04am

Copy link

changeset-bot bot commented May 14, 2024

🦋 Changeset detected

Latest commit: 0e809ce

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 12 packages
Name Type
@ant-design/web3-assets Patch
@ant-design/web3-common Patch
@ant-design/web3 Minor
@ant-design/web3-eth-web3js Patch
@ant-design/web3-ethers-v5 Patch
@ant-design/web3-ethers Patch
@ant-design/web3-solana Patch
@ant-design/web3-wagmi Patch
@example/eth-web3js Patch
@example/ethers-v5 Patch
@example/ethers Patch
@ant-design/web3-bitcoin Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

github-actions bot commented May 14, 2024

Preview is ready

packages/assets/src/tokens/usdt.tsx Outdated Show resolved Hide resolved
packages/assets/src/wallets/meta-mask.tsx Outdated Show resolved Hide resolved
packages/assets/src/wallets/meta-mask.tsx Outdated Show resolved Hide resolved
packages/web3/src/pay-panel/ChainList.tsx Outdated Show resolved Hide resolved
packages/web3/src/pay-panel/demos/basic.tsx Outdated Show resolved Hide resolved
packages/web3/src/pay-panel/ShowCode.tsx Outdated Show resolved Hide resolved
packages/web3/src/pay-panel/ShowCode.tsx Outdated Show resolved Hide resolved
packages/web3/src/pay-panel/ShowCode.tsx Outdated Show resolved Hide resolved
@Likang0122 Likang0122 requested a review from gin-lsl May 14, 2024 08:49
@Likang0122
Copy link
Collaborator Author

#812

Copy link

codecov bot commented May 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (fb35753) to head (0e809ce).

Additional details and impacted files
@@            Coverage Diff             @@
##              main      #876    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files          712       717     +5     
  Lines        21610     21868   +258     
  Branches      1225      1250    +25     
==========================================
+ Hits         21610     21868   +258     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -0,0 +1,7 @@
---
'@ant-design/web3-assets': patch
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个也应该是 minor,新增了 type

* @desc 支持的链虚拟机类型
* @descEn Supported chain virtual machine types
*/
supportChainTypes?: string[];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个类型应该是 ChainType 吧,不是 string。

* @desc 快捷扫码的参数是否支持
* @descEn Whether the parameters of fast scan code are supported
*/
payQRCodeFormatterFunc?: (params: Record<string, any>) => string;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

没必要后面再带一个 Func,叫 transferQRCodeFormatter 就好了。

另外 params 要具体定义一下,不要用 Record,有哪些参赛应该是明确的。

<div className={`${prefixCls}-code-content`}>
<div className={`${prefixCls}-code-tips`}>
<InfoCircleOutlined />
<span>Please scan the QR code or copy the address</span>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

国际化可以加一下


const [paymentLink, setPaymentLink] = useState<string>(toAddress);

const availableWallets = useMemo(() => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这两个 useMemo 感觉都没啥必要,直接算就好了。

target={{
[Mainnet.id]: {
address: '0x35ceCD3d51Fe9E5AD14ea001475668C5A5e5ea76',
chain: Mainnet,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

为啥还要穿 chain?我理解用户传每个链对应的地址就行

| --- | --- | --- | --- | --- |
| target | 支持的链及对应的接收地址 | `{ [chainId: string]: { address: string; chain: Chain } }` | - | - |
| token | Token 的信息 | `Token` | - | - |
| amount | 指定的数量 | `number \| bigint` | - | - |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

amount 这个如果传 1 是代表 1 个 USDT 吗?应该是转换后的吧,感觉要写清楚,不然很容易理解错误

@yutingzhao1991
Copy link
Collaborator

demo 中的 padding 看上去不太对,留白有点太多了,这个给设计师走查一下吧

image image

@yutingzhao1991
Copy link
Collaborator

image

图标和文案之间应该有空格

@yutingzhao1991
Copy link
Collaborator

image

其他都有图标,第一个没有,感觉有点不太一致,看看是不是也可以加一个图标

@yutingzhao1991
Copy link
Collaborator

image

选择网络的时候这么素吗?我记得应该还要有一些预估 gas、是否推荐啥的?设计稿什么样的?

return (
<Card style={{ width: 450 }}>
<PayPanel
target={{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

要考虑下实际应用场景,感觉很多情况下地址都是服务端生成的,target 应该要支持下 (chain: Chain) => { address: string };

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants