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: Avatar support size from ConfigProvider #44288

Merged
merged 4 commits into from Aug 18, 2023
Merged

feat: Avatar support size from ConfigProvider #44288

merged 4 commits into from Aug 18, 2023

Conversation

li-jia-nan
Copy link
Member

@li-jia-nan li-jia-nan commented Aug 18, 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

📝 Changelog

Language Changelog
🇺🇸 English feat: Avatar support size from ConfigProvider
🇨🇳 Chinese Avatar 支持使用 CP 配置 size

☑️ 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 573af54

This pull request enhances the Avatar component to support the componentSize feature of the ConfigProvider component. It also refactors the size property and adds a test case for the new feature.

🔍 Walkthrough

🤖 Generated by Copilot at 573af54

  • Remove default value of size property and use useSize hook to apply componentSize from ConfigProvider as fallback value for Avatar component (link,link,link)
  • Change default value of size property in AvatarContext to undefined to allow Avatar component to use componentSize from ConfigProvider (link)
  • Import ConfigProvider component and add test case to check that Avatar component can apply componentSize from ConfigProvider when no size is specified by user or context (link,link)

@stackblitz
Copy link

stackblitz bot commented Aug 18, 2023

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

@github-actions
Copy link
Contributor

github-actions bot commented Aug 18, 2023

Co-authored-by: MadCcc <1075746765@qq.com>
Signed-off-by: lijianan <574980606@qq.com>
@li-jia-nan li-jia-nan requested a review from MadCcc August 18, 2023 03:43
@github-actions
Copy link
Contributor

github-actions bot commented Aug 18, 2023

size-limit report 📦

Path Size
./dist/antd.min.js 389.29 KB (+8 B 🔺)
./dist/antd-with-locales.min.js 448.19 KB (+11 B 🔺)

@argos-ci
Copy link

argos-ci bot commented Aug 18, 2023

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

Build Status Details Updated (UTC)
default (Inspect) 👍 Changes approved 11 changes Aug 18, 2023, 6:32 AM

@codecov
Copy link

codecov bot commented Aug 18, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (74d9654) 100.00% compared to head (7d0edb3) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##           feature    #44288   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          663       663           
  Lines        11281     11280    -1     
  Branches      3047      3046    -1     
=========================================
- Hits         11281     11280    -1     
Files Changed Coverage Δ
components/avatar/AvatarContext.ts 100.00% <100.00%> (ø)
components/avatar/avatar.tsx 100.00% <100.00%> (ø)

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

Co-authored-by: MadCcc <1075746765@qq.com>
Signed-off-by: lijianan <574980606@qq.com>
@li-jia-nan li-jia-nan requested a review from MadCcc August 18, 2023 06:25
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