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: Added bgColor attribute to fix the problem that the background c… #42214

Merged
merged 7 commits into from
May 9, 2023

Conversation

duriann
Copy link
Contributor

@duriann duriann commented May 8, 2023

color of the QR code is displayed incorrectly when downloading

[中文版模板 / 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

close #42213

💡 Background and solution

📝 Changelog

Language Changelog
🇺🇸 English add bgColor to set qrcode backgroundColor
🇨🇳 Chinese 新增bgColor属性设置二维码背景色

☑️ Self-Check before Merge

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

  • Doc is updated/provided or not needed
  • [x ] 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 5a2bffc

Added a new bgColor prop to the QRCode component to enable customizing the background color of the QR code. Updated the component examples, interface, and documentation accordingly.

🔍 Walkthrough

🤖 Generated by Copilot at 5a2bffc

  • Add bgColor prop to QRCode component to customize the background color of the QRCode (link, link)
  • Pass bgColor prop to QRCodeGenerator options and useMemo dependency array in components/qrcode/index.tsx to render the QRCode with the correct background color (link)
  • Document bgColor prop in English and Chinese API sections of components/qrcode/index.en-US.md and components/qrcode/index.zh-CN.md with default value of transparent (link, link)
  • Replace style prop by bgColor prop in QRCode component examples in components/qrcode/demo/customColor.tsx and components/qrcode/demo/customColor.md to demonstrate how to use the new prop (link, link)
  • Adjust import order of React and antd components in components/qrcode/demo/customColor.tsx to follow convention of importing React first (link)

@github-actions
Copy link
Contributor

github-actions bot commented May 8, 2023

@kiner-tang kiner-tang requested a review from li-jia-nan May 8, 2023 07:27
@li-jia-nan
Copy link
Member

改到 feature branch 吧,另外加个测试用例

@MadCcc
Copy link
Member

MadCcc commented May 8, 2023

bgColor 也要用到容器上,不然会有白边

@duriann duriann changed the base branch from master to feature May 8, 2023 07:53
@li-jia-nan
Copy link
Member

rebase 一下,你把 master 的改动带过来了,master 的 commit 不应该出现在这里

@afc163
Copy link
Member

afc163 commented May 8, 2023

图片

…olor of the QR code is displayed incorrectly when downloading
@duriann
Copy link
Contributor Author

duriann commented May 8, 2023

rebase 一下,你把 master 的改动带过来了,master 的 commit 不应该出现在这里

好了。。

@duriann
Copy link
Contributor Author

duriann commented May 8, 2023

不会有这个问题 那个容器是用户自己写的div,下载的只是二维码的真实图片内容

@duriann
Copy link
Contributor Author

duriann commented May 8, 2023

图片

现在应该好了,第一次提pr不懂操作不好意思= =

@li-jia-nan
Copy link
Member

同步一下上游分支

@afc163
Copy link
Member

afc163 commented May 9, 2023

lint 挂了

@codecov
Copy link

codecov bot commented May 9, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (314b93b) 100.00% compared to head (e9f0515) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##           feature    #42214   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          619       619           
  Lines        10568     10569    +1     
  Branches      2885      2886    +1     
=========================================
+ Hits         10568     10569    +1     
Impacted Files Coverage Δ
components/qrcode/index.tsx 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@MadCcc
Copy link
Member

MadCcc commented May 9, 2023

背景是 antd 提供的,也要考虑进去。现在的 demo 和线上的就有区别
image
建议保留线上 demo 的样式,用新 feature 实现。

@li-jia-nan
Copy link
Member

CI 挂了,需要更新一下 snap

@li-jia-nan li-jia-nan merged commit 0e94620 into ant-design:feature May 9, 2023
51 checks passed
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.

二维码组件设置背景颜色后下载的图片显示不对
4 participants