feat(result): Support better customization with semantic classNames/styles as function#55044
feat(result): Support better customization with semantic classNames/styles as function#55044thinkasany merged 44 commits intoant-design:nextfrom
Conversation
This reverts commit 7d3a4de.
This reverts commit cfe65dd.
Signed-off-by: thinkasany <[email protected]>
|
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. ✨ Finishing touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🧪 Early access (Sonnet 4.5): enabledWe are currently testing the Sonnet 4.5 model, which is expected to improve code review quality. However, this model may lead to increased noise levels in the review comments. Please disable the early access features if the noise level causes any inconvenience. Note:
Comment |
👁 Visual Regression Report for PR #55044 Failed ❌
Important There are 3 diffs found in this PR: 🆕
|
|
@thinkasany 麻烦大佬帮我看看这个,pr有没有问题 |
There was a problem hiding this comment.
Pull Request Overview
This PR enhances the Result component to support better customization through semantic classNames and styles that can accept either objects or functions. This allows for more dynamic styling based on component props.
- Enhanced the classNames and styles props to accept functions in addition to objects
- Added proper TypeScript types for function-based styling
- Created comprehensive demo and test coverage for the new functionality
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| components/result/index.tsx | Added type imports and updated props types to support function-based classNames/styles |
| components/result/index.en-US.md | Updated API documentation to describe the new function-based styling capabilities |
| components/result/index.zh-CN.md | Updated Chinese API documentation for the new styling functionality |
| components/result/demo/style-class.tsx | Added comprehensive demo showcasing both object and function-based styling |
| components/result/demo/style-class.md | Added demo documentation explaining the new styling features |
| components/result/tests/index.test.tsx | Enhanced tests with proper types and added function-based styling test coverage |
| components/result/tests/snapshots/demo.test.ts.snap | Updated snapshots for the new demo |
| components/result/tests/snapshots/demo-extend.test.ts.snap | Updated extended snapshots for the new demo |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
都通过啦,我看起来没啥问题,等其他同学再看看~ 感谢你的贡献~ |
好的好的,麻烦了 |
Signed-off-by: lijianan <[email protected]>
Signed-off-by: lijianan <[email protected]>
| }; | ||
|
|
||
| const stylesObject: ResultProps['styles'] = { | ||
| root: { borderWidth: 2, borderStyle: 'dashed', padding: 16 }, |
Signed-off-by: thinkasany <[email protected]>







中文版模板 / Chinese template
🤔 This is a ...
🔗 Related Issues
💡 Background and Solution
📝 Change Log