Skip to content

feat(Result): support classNames and styles for component and ConfigProvider - #52171

Merged
zombieJ merged 4 commits into
ant-design:nextfrom
thinkasany-forks:cp-result
Dec 31, 2024
Merged

zombieJ merged 4 commits into
ant-design:nextfrom
thinkasany-forks:cp-result

Conversation

@thinkasany

Copy link
Copy Markdown
Member

中文版模板 / Chinese template

🤔 This is a ...

  • 🆕 New feature

🔗 Related Issues

  • Describe the source of related requirements, such as links to relevant issue discussions.
  • For example: close #xxxx, fix #xxxx

💡 Background and Solution

  • The specific problem to be addressed.
  • List the final API implementation and usage if needed.
  • If there are UI/interaction changes, consider providing screenshots or GIFs.

📝 Change Log

Language Changelog
🇺🇸 English feat: ConfigProvider support classNames and styles for Result
🇨🇳 Chinese feat: ConfigProvider 支持 Result 组件的classNames 和styles 配置

@bolt-new-by-stackblitz

Copy link
Copy Markdown

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

@github-actions

github-actions Bot commented Dec 30, 2024 •

Copy link
Copy Markdown
Contributor

👁 Visual Regression Report for PR #52171 Passed ✅

🎯 Target branch: next (89c1a05)
📖 View Full Report ↗︎

🎊 Congrats! No visual-regression diff found.

@github-actions

github-actions Bot commented Dec 30, 2024 •

Copy link
Copy Markdown
Contributor

Preview is ready

@petercat-assistant

Copy link
Copy Markdown

Walkthrough

This pull request introduces a new feature to the ConfigProvider component, allowing it to support classNames and styles for the Result component. This enhancement provides developers with more flexibility in customizing the appearance of the Result component by specifying custom class names and styles.

Changes

Files Changed Summary
components/config-provider/context.ts Added ResultConfig type to support classNames and styles for Result.
components/config-provider/index.en-US.md Updated documentation to include classNames and styles for Result.
components/config-provider/index.zh-CN.md Updated Chinese documentation to include classNames and styles for Result.
components/result/tests/index.test.tsx Added tests to verify custom styles and class names are applied to Result.
components/result/demo/_semantic.tsx Added a new demo showcasing semantic DOM usage for Result.
components/result/index.en-US.md Added semantic DOM section to English documentation.
components/result/index.tsx Enhanced Result component to accept classNames and styles props.
components/result/index.zh-CN.md Added semantic DOM section to Chinese documentation.

@@ -52,14 +68,13 @@ const ExceptionStatus = Object.keys(ExceptionMap);
*/

interface IconProps {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The IconProps interface has been modified to replace prefixCls with className and added an optional style property. Ensure that all usages of IconProps are updated accordingly to prevent potential runtime errors.

@thinkasany thinkasany mentioned this pull request Dec 30, 2024
@pkg-pr-new

pkg-pr-new Bot commented Dec 30, 2024 •

Copy link
Copy Markdown

@codecov

codecov Bot commented Dec 30, 2024 •

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (89c1a05) to head (1523cf8).
Report is 1 commits behind head on next.

Additional details and impacted files
@@            Coverage Diff            @@
##              next    #52171   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          763       763           
  Lines        13643     13650    +7     
  Branches      3561      3563    +2     
=========================================
+ Hits         13643     13650    +7     

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

Comment thread components/result/demo/_semantic.tsx Outdated
subTitle: '副标题元素',
body: '内容元素',
extra: '额外元素',
image: '图标元素',

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

这个应该是 icon?

@codecov

codecov Bot commented Dec 30, 2024 •

Copy link
Copy Markdown

Bundle Report

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

Detailed changes
Bundle name Size Change
antd.min-array-push 3.38MB 5.08kB (0.15%) ⬆️

Comment thread components/result/index.tsx Outdated
);

const bodyClassNames = classNames(
`${prefixCls}-content`,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

这里也要变成 body,否则会让人疑惑的。挪到 next 里吧。

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

done

@thinkasany
thinkasany changed the base branch from feature to next December 30, 2024 11:02
@thinkasany
thinkasany requested a review from zombieJ December 30, 2024 11:58
);

const bodyClassNames = classNames(
`${prefixCls}-body`,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

这边替换后,style/index.ts 里的没有替换。

@zombieJ
zombieJ merged commit 6f2b330 into ant-design:next Dec 31, 2024
@Wxh16144 Wxh16144 changed the title feat: ConfigProvider support classNames and styles for Result feat(Result): support classNames and styles for component and ConfigProvider Nov 28, 2025
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