feat(Message): support classNames and styles for component and ConfigProvider#52793
feat(Message): support classNames and styles for component and ConfigProvider#52793
classNames and styles for component and ConfigProvider#52793Conversation
|
|
👁 Visual Regression Report for PR #52793 Failed ❌
Important There are 2 diffs found in this PR: 🔄
|
WalkthroughThis pull request introduces a new feature to the ConfigProvider, allowing support for classnames and styles specifically for messages. The changes include updates to type definitions, component configurations, and documentation to accommodate the new styling capabilities for message components. Changes
|
size-limit report 📦
|
More templates
commit: |
Bundle ReportChanges will increase total bundle size by 6.35kB (0.05%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: antd.min-array-pushAssets Changed:
Files in
Files in
|
Deploying ant-design with
|
| Latest commit: |
5d44b54
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://6e247074.ant-design.pages.dev |
| Branch Preview URL: | https://cp-message.ant-design.pages.dev |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## next #52793 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 765 765
Lines 13790 13798 +8
Branches 3612 3616 +4
=========================================
+ Hits 13790 13798 +8 ☔ View full report in Codecov by Sentry. |
components/message/PurePanel.tsx
Outdated
| const iconElement = icon || (type && TypeIcon[type]); | ||
| const iconNode: React.ReactNode = cloneElement(iconElement, { | ||
| className: classNames( | ||
| React.isValidElement(iconElement) |
There was a problem hiding this comment.
改造一下 cloneElement 吧,支持 renderProps 入参为原始的 props,这样可以少写一次 React.isValidElement
components/message/PurePanel.tsx
Outdated
| : '', | ||
| PureContentClassNames?.icon, | ||
| ), | ||
| style: { ...styles?.icon }, |
e9d090d to
4ac977b
Compare
components/message/PurePanel.tsx
Outdated
| type, | ||
| icon, | ||
| children, | ||
| classNames: PureContentClassNames, |
There was a problem hiding this comment.
一般组件才会大写,这里不用大写。可以写成 propsClassNames
components/message/PurePanel.tsx
Outdated
| }) => { | ||
| const iconElement = icon || (type && TypeIcon[type]); | ||
| const iconNode: React.ReactNode = cloneElement(iconElement, (currentProps) => ({ | ||
| className: classNames(currentProps?.className, PureContentClassNames?.icon), |
There was a problem hiding this comment.
这里应该是不需要 ?. 的,能执行到这个函数是一定有 props 的
classNames and styles for component and ConfigProvider







🤔 This is a ...
📝 Change Log