-
Notifications
You must be signed in to change notification settings - Fork 103
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
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
🦋 Changeset detectedLatest commit: 0e809ce The changes in this PR will be included in the next version bump. This PR includes changesets to release 12 packages
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 |
Codecov ReportAll modified and coverable lines are covered by tests ✅
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. |
@@ -0,0 +1,7 @@ | |||
--- | |||
'@ant-design/web3-assets': patch |
There was a problem hiding this comment.
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[]; |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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(() => { |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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` | - | - | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
amount 这个如果传 1
是代表 1 个 USDT 吗?应该是转换后的吧,感觉要写清楚,不然很容易理解错误
return ( | ||
<Card style={{ width: 450 }}> | ||
<PayPanel | ||
target={{ |
There was a problem hiding this comment.
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 }
;
No description provided.