Skip to content

Comments

feat: configProvider support Card.Meta#52214

Merged
thinkasany merged 2 commits intoant-design:nextfrom
thinkasany-forks:cp-card-next
Jan 22, 2025
Merged

feat: configProvider support Card.Meta#52214
thinkasany merged 2 commits intoant-design:nextfrom
thinkasany-forks:cp-card-next

Conversation

@thinkasany
Copy link
Member

@thinkasany thinkasany commented Jan 3, 2025

🤔 This is a ...

  • 🆕 New feature

📝 Change Log

Language Changelog
🇺🇸 English feat: configProvider support Card.Meta
🇨🇳 Chinese feat: configProvider 支持 Card.Meta的配置

@bolt-new-by-stackblitz
Copy link

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

@github-actions
Copy link
Contributor

github-actions bot commented Jan 3, 2025

Preview is ready

@github-actions
Copy link
Contributor

github-actions bot commented Jan 3, 2025

👁 Visual Regression Report for PR #52214 Failed ❌

🎯 Target branch: next (1f50049)
📖 View Full Report ↗︎
📊 Summary: 🔄 1 changed

Expected (Branch next) Actual (Current PR) Diff
input-group.compact.png input-group.compact.png input-group.compact.css-var.png input-group.compact.css-var.png

Important

There are 1 diffs found in this PR: 🔄 1 changed.
Please check all items:

  • Visual diff is acceptable

@petercat-assistant
Copy link

  • Walkthrough: This pull request introduces support for configuring Card.Meta through the ConfigProvider. It adds new properties for class names and styles, allowing for more flexible customization of the Card.Meta component.
  • Changes:
    Files Summary
    components/card/Card.tsx, components/card/Meta.tsx Added support for custom class names and styles for Card and Card.Meta.
    components/config-provider/context.ts, components/config-provider/index.tsx Introduced CardMetaConfig for ConfigProvider.
    components/card/tests/index.test.tsx Updated tests to cover new customization options.
    components/card/demo/_semantic.tsx, components/card/demo/_semantic_meta.tsx Added semantic demos for Card and Card.Meta.
    components/card/index.en-US.md, components/card/index.zh-CN.md Updated documentation to include Card.Meta configuration.

rootClassName,
hashId,
cssVarCls,
card?.classNames?.root,

Choose a reason for hiding this comment

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

Ensure that card?.classNames?.root and customClassNames?.root are properly defined before using them in classNames. This could potentially lead to undefined behavior if not handled correctly.

const rootClassNames = classNames(
metaPrefixCls,
className,
cardMeta?.className,

Choose a reason for hiding this comment

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

Ensure that cardMeta?.className and cardMeta?.classNames?.root are properly defined before using them in classNames. This could potentially lead to undefined behavior if not handled correctly.

@thinkasany thinkasany mentioned this pull request Jan 3, 2025
@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 3, 2025

Open in Stackblitz

More templates

npm i https://pkg.pr.new/ant-design/ant-design/antd@52214

commit: d0cf3aa

@codecov
Copy link

codecov bot commented Jan 3, 2025

Bundle Report

Changes will increase total bundle size by 7.29kB (0.22%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
antd.min-array-push 3.4MB 7.29kB (0.22%) ⬆️

@codecov
Copy link

codecov bot commented Jan 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (1f50049) to head (d0cf3aa).
Report is 59 commits behind head on next.

Additional details and impacted files
@@            Coverage Diff            @@
##              next    #52214   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          760       760           
  Lines        13681     13691   +10     
  Branches      3576      3576           
=========================================
+ Hits         13681     13691   +10     

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


const locales = {
cn: {
root: '设置卡片根元素',
Copy link
Member

Choose a reason for hiding this comment

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

这里帮忙换一下顺序,从 头 到 cover 到 body 到 action。现在鼠标滑动的时候,它上下来回跑还挺不顺的

},
en: {
root: 'set `root` of Card.Meta',
content: 'set `content` of Card.Meta',
Copy link
Member

Choose a reason for hiding this comment

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

有点点怪,因为 content 一般在 body 下面,而 body 和 header 是平级关系,现在这个 content 包含了 title 和 description。和其他的逻辑不一样。得找找这种二级容器的替代词。

@thinkasany thinkasany force-pushed the cp-card-next branch 2 times, most recently from 58e5ab4 to c902cc2 Compare January 3, 2025 13:40
@@ -0,0 +1,60 @@
import React from 'react';
Copy link
Member

@zombieJ zombieJ Jan 7, 2025

Choose a reason for hiding this comment

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

一起加个 paddingTop or 垂直居中一下~贴顶看起来有点局促

截屏2025-01-07 16 02 03

@thinkasany thinkasany force-pushed the cp-card-next branch 2 times, most recently from 4e35219 to 74f92f3 Compare January 10, 2025 08:33
@thinkasany thinkasany merged commit 96bf79f into ant-design:next Jan 22, 2025
37 of 38 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.

2 participants