-
-
Notifications
You must be signed in to change notification settings - Fork 103
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
chore: adjust classNames and styles #380
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Walkthrough这个 PR 对与图片组件预览相关的类型和接口进行了重构。主要修改包括:
Changes
Possibly related PRs
Suggested reviewers
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure. 🔧 ESLint
src/Image.tsxOops! Something went wrong! :( ESLint: 8.57.1 ESLint couldn't find the config "prettier" to extend from. Please check that the name of the config is correct. The config "prettier" was referenced from the config file in "/.eslintrc.js". If you still have problems, please stop by https://eslint.org/chat/help to chat with the team. src/Operations.tsxOops! Something went wrong! :( ESLint: 8.57.1 ESLint couldn't find the config "prettier" to extend from. Please check that the name of the config is correct. The config "prettier" was referenced from the config file in "/.eslintrc.js". If you still have problems, please stop by https://eslint.org/chat/help to chat with the team. src/Preview.tsxOops! Something went wrong! :( ESLint: 8.57.1 ESLint couldn't find the config "prettier" to extend from. Please check that the name of the config is correct. The config "prettier" was referenced from the config file in "/.eslintrc.js". If you still have problems, please stop by https://eslint.org/chat/help to chat with the team. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #380 +/- ##
=======================================
Coverage 99.79% 99.79%
=======================================
Files 15 15
Lines 486 486
Branches 139 139
=======================================
Hits 485 485
Misses 1 1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
src="https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png" | ||
width="200" | ||
/> | ||
<div> |
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.
见上,不能加这个 div。rootClassName 是分别加到 inline 和 popup 最外层
src/Preview.tsx
Outdated
@@ -51,6 +51,9 @@ export interface PreviewProps extends Omit<IDialogPropTypes, 'onClose' | 'styles | |||
}; | |||
fallback?: string; | |||
movable?: boolean; | |||
/** | |||
* @deprecated please use `Image.rootClassName` instead | |||
*/ |
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.
在 Image 里改成了:
rootClassName={classNames(rootClassName, imageClassNames?.root)}
到这里又写了个 @deprecated
感觉很奇怪。这里理论上来说 Preview 组件是外面不能直接使用的,也没有 @depreactead
说法。
src/Preview.tsx
Outdated
@@ -311,8 +314,7 @@ const Preview: React.FC<PreviewProps> = props => { | |||
mask: styles?.mask, | |||
wrapper: styles?.wrapper, | |||
}} | |||
style={styles?.root} | |||
rootClassName={classnames(rootClassName, imageClassNames?.root)} | |||
rootClassName={classnames(rootClassName)} |
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.
单个 className 不需要 classnames
方法
Summary by CodeRabbit