-
-
Notifications
You must be signed in to change notification settings - Fork 53.5k
feat: ConfigProvider support classNames
and styles
for Descriptions
#52120
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
Conversation
|
👁 Visual Regression Report for PR #52120 Failed ❌
Warning There are more diffs not shown in the table. Please check the Full Report for details. Important There are 35 diffs found in this PR: 🔄 35 changed.
|
WalkthroughThis pull request introduces a new feature to the Changes
|
{notEmpty(label) && <span style={labelStyle}>{label}</span>} | ||
{notEmpty(content) && <span style={contentStyle}>{content}</span>} | ||
{notEmpty(label) && <span style={{ ...labelStyle, ...styles?.label }}>{label}</span>} | ||
{notEmpty(content) && <span style={{ ...labelStyle, ...styles?.content }}>{content}</span>} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure that labelStyle
is used for label and contentStyle
for content. The current code mistakenly uses labelStyle
for both.
More templates
commit: |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## feature #52120 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 763 763
Lines 13735 13744 +9
Branches 3587 3590 +3
=========================================
+ Hits 13735 13744 +9 ☔ View full report in Codecov by Sentry. |
29db616
to
25ecfc3
Compare
contentStyle?: React.CSSProperties; | ||
styles?: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR 里带上你这个变更的描述,我更新到 RFC 里去~
en: { | ||
root: 'root element', | ||
label: 'label element', | ||
content: 'content element', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
少了 title
extra
,另外需要确认一下 title
是否是一个好名字,还是应该用 header
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bundle ReportChanges will decrease total bundle size by 6.23MB (-64.91%) ⬇️. This is within the configured threshold ✅ Detailed changes
|
const App: React.FC = () => { | ||
const [locale] = useLocale(locales); | ||
return ( | ||
<SemanticPreview |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
参考 input 的形式再加一个表单形式的预览
@@ -0,0 +1,62 @@ | |||
import React from 'react'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
似乎占地有点多,加个 Switch 切换算了
}; | ||
|
||
return ( | ||
<div ref={divRef} style={{ width: 240, height: 100 }}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…ign into cp-descriptions
<Descriptions | ||
title="User Info" | ||
items={items} | ||
extra={'extra'} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{`extra`}
=> "extra"
,话说这个能改成 Button 之类的东西么。extra 文字视觉上看起来怪怪的
}; | ||
|
||
return ( | ||
<div ref={divRef} style={{ width: '100%', height: 100 }}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个 height 不对呀,不需要这个高度的。另外可以做成上对齐的不,中间对齐的看起来还是比较怪异。
🤔 This is a ...
RFC: #51885
classNames
andstyles
for DescriptionsclassNames
和styles