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

refactor: popconfirm support css var #45840

Merged
merged 5 commits into from
Nov 14, 2023
Merged

refactor: popconfirm support css var #45840

merged 5 commits into from
Nov 14, 2023

Conversation

c0dedance
Copy link
Contributor

@c0dedance c0dedance commented Nov 13, 2023

[中文版模板 / Chinese template]

🤔 This is a ...

  • New feature
  • Bug fix
  • Site / documentation update
  • Demo update
  • Component style update
  • TypeScript definition update
  • Bundle size optimization
  • Performance optimization
  • Enhancement feature
  • Internationalization
  • Refactoring
  • Code style optimization
  • Test Case
  • Branch merge
  • Workflow
  • Other (about what?)

🔗 Related issue link

#45618

💡 Background and solution

📝 Changelog

Language Changelog
🇺🇸 English Popconfirm support css variables.
🇨🇳 Chinese Popconfirm 组件支持 CSS 变量。

☑️ Self-Check before Merge

⚠️ Please check all items below before requesting a reviewing. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

🚀 Summary

🤖 Generated by Copilot at dfe4068

Refactored the popconfirm component to use a custom hook for registering and wrapping CSS variables. This improves code readability and consistency, and reduces the dependency on the theme package.

🔍 Walkthrough

🤖 Generated by Copilot at dfe4068

  • Rename useStyle and wrapSSR imports and functions to useCSSVar and wrapCSSVar respectively, to avoid confusion and indicate usage of CSS variables in popconfirm component (link, link, link, link)
  • Add cssVar.ts file to export genCSSVarRegister function that creates a custom hook for registering and wrapping the CSS variables for the popconfirm component (link)
  • Import GetDefaultToken type from theme package and extract and export prepareComponentToken function from genComponentStyleHook call in style/index.tsx file, to generate the default token for the popconfirm component that includes the zIndexPopup value (link, link)
  • Remove popconfirm entry from checkCSSVar function in scripts/check-cssinjs.tsx script, because the popconfirm component no longer uses the useStyle hook from the theme package (link)

Copy link

stackblitz bot commented Nov 13, 2023

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link
Contributor

github-actions bot commented Nov 13, 2023

Preview Is ready

Copy link
Contributor

Hi @c0dedance. Thanks for your contribution. The path .github/ or scripts/ and CHANGELOG is only maintained by team members. This current PR will be closed and team members will help on this.

Copy link

codesandbox-ci bot commented Nov 13, 2023

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit a73ca8b:

Sandbox Source
antd reproduction template (forked) Configuration

Copy link

argos-ci bot commented Nov 13, 2023

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) 👍 Changes approved 1 change Nov 13, 2023, 1:57 PM

@li-jia-nan li-jia-nan reopened this Nov 13, 2023
Copy link

codecov bot commented Nov 13, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (c8637cf) 100.00% compared to head (a73ca8b) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##           feature    #45840   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          706       706           
  Lines        12052     12054    +2     
  Branches      3197      3197           
=========================================
+ Hits         12052     12054    +2     
Files Coverage Δ
components/popconfirm/PurePanel.tsx 100.00% <100.00%> (ø)
components/popconfirm/index.tsx 100.00% <100.00%> (ø)

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

Signed-off-by: MadCcc <madccc@foxmail.com>
Signed-off-by: MadCcc <1075746765@qq.com>
MadCcc and others added 2 commits November 13, 2023 21:26
@MadCcc MadCcc merged commit 308d7ca into ant-design:feature Nov 14, 2023
54 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants