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: FloatButtonGroup menu mode should support badge #44109

Merged
merged 3 commits into from Aug 8, 2023

Conversation

MadCcc
Copy link
Member

@MadCcc MadCcc commented Aug 8, 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

💡 Background and solution

顺便优化了一下 dom 结构。原本没有 tooltip 和 badge 属性时也会套一层 Tooltip 或者 Badge,这不但会导致 dom 增加,还会引入不需要的样式。

📝 Changelog

Language Changelog
🇺🇸 English Fix FloatButton that menu mode didn't support badge prop.
🇨🇳 Chinese 修复 FloatButton 组件菜单模式不支持 badge 配置的问题。

☑️ 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 5a28f5b

This pull request enhances the FloatButtonGroup and FloatButton components with a new badge prop that allows displaying a badge on the floating buttons. It also refactors the components to improve their state management, performance, and accessibility. It adds a new test case and a new demo example to verify and showcase the new feature.

🔍 Walkthrough

🤖 Generated by Copilot at 5a28f5b

  • Refactor FloatButton component to conditionally render Tooltip and Badge components based on tooltip and badge props (link)
  • Update FloatButtonGroup component to accept floatButtonProps prop for passing additional props to FloatButton children (link, link)
  • Update FloatButtonGroup component to use customOpen prop derived from open and trigger props for state management and consistency (link, link)
  • Add new example to group-menu.tsx file to demonstrate badge prop usage in FloatButtonGroup component (link)
  • Add new test case to group.test.tsx file to verify badge prop rendering in FloatButton component (link)

@stackblitz
Copy link

stackblitz bot commented Aug 8, 2023

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

@github-actions
Copy link
Contributor

github-actions bot commented Aug 8, 2023

@github-actions
Copy link
Contributor

github-actions bot commented Aug 8, 2023

size-limit report 📦

Path Size
./dist/antd.min.js 386.74 KB (+74 B 🔺)
./dist/antd-with-locales.min.js 445.88 KB (+55 B 🔺)

@argos-ci
Copy link

argos-ci bot commented Aug 8, 2023

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

Build Status Details Updated (UTC)
default (Inspect) ✅ No change detected - Aug 8, 2023, 9:29 AM

@codecov
Copy link

codecov bot commented Aug 8, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (7ff17e0) 100.00% compared to head (c22e31e) 100.00%.
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master    #44109   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          658       658           
  Lines        11186     11191    +5     
  Branches      3029      3031    +2     
=========================================
+ Hits         11186     11191    +5     
Files Changed Coverage Δ
components/float-button/FloatButton.tsx 100.00% <100.00%> (ø)
components/float-button/FloatButtonGroup.tsx 100.00% <100.00%> (ø)

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

@MadCcc MadCcc merged commit bb4b3f6 into master Aug 8, 2023
88 checks passed
@MadCcc MadCcc deleted the fix/float-button-badge branch August 8, 2023 10:05
@MadCcc MadCcc mentioned this pull request Aug 10, 2023
20 tasks
@PeachScript PeachScript mentioned this pull request Aug 11, 2023
20 tasks
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

2 participants