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

fix(web3): connect modal connecting should not display skeleton #944

Merged
merged 9 commits into from
Jun 12, 2024

Conversation

gin-lsl
Copy link
Collaborator

@gin-lsl gin-lsl commented Jun 11, 2024

[中文版模板 / Chinese template]

💡 Background and solution

antd 5.18.0 的 Modal 新增了 loading 属性,会展示骨架屏,与 ConnectModal UI 冲突,需要特殊处理下。
image

🔗 Related issue link

Copy link

vercel bot commented Jun 11, 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 12, 2024 2:07am

Copy link

changeset-bot bot commented Jun 11, 2024

🦋 Changeset detected

Latest commit: d3f1b07

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

This PR includes changesets to release 4 packages
Name Type
@ant-design/web3 Patch
@example/eth-web3js Patch
@example/ethers-v5 Patch
@example/ethers 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 Jun 11, 2024

Preview is ready

@yutingzhao1991
Copy link
Collaborator

loading 应该不是默认 true 吧?为啥我们也会出现 loading?

如果 antd 的 modal 支持 loading,我们的 ConnectModal 最好保留这个功能,只是说 UI 上面 padding 要优化下。

@gin-lsl
Copy link
Collaborator Author

gin-lsl commented Jun 11, 2024

loading 应该不是默认 true 吧?为啥我们也会出现 loading?

如果 antd 的 modal 支持 loading,我们的 ConnectModal 最好保留这个功能,只是说 UI 上面 padding 要优化下。

因为我们有个对 Modal 的 Context,里面正好有个名为 loading 的属性,不幸与 antd 的重名了。

@gin-lsl
Copy link
Collaborator Author

gin-lsl commented Jun 11, 2024

它的 loading 是用骨架屏实现的,跟我们的样式不太搭。

@yutingzhao1991
Copy link
Collaborator

它的 loading 是用骨架屏实现的,跟我们的样式不太搭。

感觉还好啊,作为 Modal 整体的 loading,骨架屏感觉也还好

@gin-lsl
Copy link
Collaborator Author

gin-lsl commented Jun 11, 2024

主要是会导致这种样式:

Kapture.2024-06-11.at.11.02.46.mp4

@yutingzhao1991
Copy link
Collaborator

主要是会导致这种样式:

Kapture.2024-06-11.at.11.02.46.mp4

为啥里面连接状态会导致外面出现 loading?那这个设计有问题,应该分开。

@yutingzhao1991
Copy link
Collaborator

https://github.com/ant-design/ant-design-web3/blob/main/packages/web3/src/connect-modal/components/ModalPanel.tsx#L32C5-L32C12

这个 loading 换成 connecting 吧,语义上就区分开。

@@ -203,7 +203,7 @@ export type Balance = BalanceMetadata & {

export interface ConnectorTriggerProps {
account?: Account;
loading?: boolean;
connecting?: boolean;
Copy link
Collaborator

Choose a reason for hiding this comment

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

这个影不需要改,这个是指 按钮的 loading,应该叫 loading 是合理的。

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

Copy link

codecov bot commented Jun 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (f6f6f73) to head (d3f1b07).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #944   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          712       712           
  Lines        21624     21624           
  Branches      1225      1225           
=========================================
  Hits         21624     21624           

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

@yutingzhao1991
Copy link
Collaborator

@jeasonstudio 这个看一下,今天发个版本,这个问题应该会导致开发者使用最新版本的 antd 时异常。

Copy link
Collaborator

@jeasonstudio jeasonstudio left a comment

Choose a reason for hiding this comment

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

文档是不是忘了改了

Co-authored-by: 愚指导 <yutingzhao1991@gmail.com>
@gin-lsl
Copy link
Collaborator Author

gin-lsl commented Jun 12, 2024

文档是不是忘了改了

ConnectModal 的文档是吗?我来补一下。

@jeasonstudio jeasonstudio merged commit f4f9dc4 into main Jun 12, 2024
12 checks passed
@jeasonstudio jeasonstudio deleted the fix/modal-should-not-pass-loading branch June 12, 2024 03:40
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