-
-
Notifications
You must be signed in to change notification settings - Fork 112
chore: adjust classNames and styles #380
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,7 +3,7 @@ import Dialog from '@rc-component/dialog'; | |
| import KeyCode from '@rc-component/util/lib/KeyCode'; | ||
| import classnames from 'classnames'; | ||
| import React, { useContext, useEffect, useRef, useState } from 'react'; | ||
| import type { ImgInfo, SemanticName } from './Image'; | ||
| import type { ImgInfo, PreviewSemanticName } from './Image'; | ||
| import Operations from './Operations'; | ||
| import { PreviewGroupContext } from './context'; | ||
| import type { TransformAction, TransformType } from './hooks/useImageTransform'; | ||
|
|
@@ -51,6 +51,9 @@ export interface PreviewProps extends Omit<IDialogPropTypes, 'onClose' | 'styles | |
| }; | ||
| fallback?: string; | ||
| movable?: boolean; | ||
| /** | ||
| * @deprecated please use `Image.rootClassName` instead | ||
| */ | ||
|
||
| rootClassName?: string; | ||
| icons?: { | ||
| rotateLeft?: React.ReactNode; | ||
|
|
@@ -81,8 +84,8 @@ export interface PreviewProps extends Omit<IDialogPropTypes, 'onClose' | 'styles | |
| info: ToolbarRenderInfoType, | ||
| ) => React.ReactNode; | ||
| onChange?: (current, prev) => void; | ||
| classNames?: Partial<Record<SemanticName, string>>; | ||
| styles?: Partial<Record<SemanticName, React.CSSProperties>> & { | ||
| classNames?: Partial<Record<PreviewSemanticName, string>>; | ||
| styles?: Partial<Record<PreviewSemanticName, React.CSSProperties>> & { | ||
| /** Temporarily used in PurePanel, not used externally by antd */ | ||
| wrapper?: React.CSSProperties; | ||
| }; | ||
|
|
@@ -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)} | ||
thinkasany marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| getContainer={getContainer} | ||
| {...restProps} | ||
| afterClose={onAfterClose} | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,16 @@ | ||
| // Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
|
||
| exports[`Basic snapshot 1`] = ` | ||
| <div | ||
| class="rc-image" | ||
| style="width: 200px;" | ||
| > | ||
| <img | ||
| class="rc-image-img" | ||
| src="https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png" | ||
| width="200" | ||
| /> | ||
| <div> | ||
|
||
| <div | ||
| class="rc-image" | ||
| style="width: 200px;" | ||
| > | ||
| <img | ||
| class="rc-image-img" | ||
| src="https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png" | ||
| width="200" | ||
| /> | ||
| </div> | ||
| </div> | ||
| `; | ||
Uh oh!
There was an error while loading. Please reload this page.