@@ -3,7 +3,7 @@ import Portal, { type PortalProps } from '@rc-component/portal';
33import { useEvent } from '@rc-component/util' ;
44import useLayoutEffect from '@rc-component/util/lib/hooks/useLayoutEffect' ;
55import KeyCode from '@rc-component/util/lib/KeyCode' ;
6- import classnames from 'classnames ' ;
6+ import { clsx } from 'clsx ' ;
77import React , { useContext , useEffect , useRef , useState } from 'react' ;
88import { PreviewGroupContext } from '../context' ;
99import type { TransformAction , TransformType } from '../hooks/useImageTransform' ;
@@ -410,27 +410,23 @@ const Preview: React.FC<PreviewProps> = props => {
410410
411411 return (
412412 < div
413- className = { classnames ( prefixCls , rootClassName , classNames . root , motionClassName , {
413+ className = { clsx ( prefixCls , rootClassName , classNames . root , motionClassName , {
414414 [ `${ prefixCls } -moving` ] : isMoving ,
415415 } ) }
416416 style = { mergedStyle }
417417 >
418418 { /* Mask */ }
419419 < div
420- className = { classnames ( `${ prefixCls } -mask` , classNames . mask ) }
420+ className = { clsx ( `${ prefixCls } -mask` , classNames . mask ) }
421421 style = { styles . mask }
422422 onClick = { onClose }
423423 />
424424
425425 { /* Body */ }
426- < div className = { classnames ( `${ prefixCls } -body` , classNames . body ) } style = { bodyStyle } >
426+ < div className = { clsx ( `${ prefixCls } -body` , classNames . body ) } style = { bodyStyle } >
427427 { /* Preview Image */ }
428428 { imageRender
429- ? imageRender ( imgNode , {
430- transform,
431- image,
432- ...( groupContext ? { current } : { } ) ,
433- } )
429+ ? imageRender ( imgNode , { transform, image, ...( groupContext ? { current } : { } ) } )
434430 : imgNode }
435431 </ div >
436432
0 commit comments