1- import classNames from 'classnames ' ;
1+ import { clsx } from 'clsx ' ;
22import type { CSSMotionProps } from '@rc-component/motion' ;
33import CSSMotion from '@rc-component/motion' ;
44import KeyCode from '@rc-component/util/lib/KeyCode' ;
@@ -248,17 +248,13 @@ const DrawerPopup: React.ForwardRefRenderFunction<
248248 maskRef ,
249249 ) => (
250250 < div
251- className = { classNames (
251+ className = { clsx (
252252 `${ prefixCls } -mask` ,
253253 motionMaskClassName ,
254254 drawerClassNames ?. mask ,
255255 maskClassName ,
256256 ) }
257- style = { {
258- ...motionMaskStyle ,
259- ...maskStyle ,
260- ...styles ?. mask ,
261- } }
257+ style = { { ...motionMaskStyle , ...maskStyle , ...styles ?. mask } }
262258 onClick = { maskClosable && open ? onClose : undefined }
263259 ref = { maskRef }
264260 />
@@ -372,11 +368,8 @@ const DrawerPopup: React.ForwardRefRenderFunction<
372368 id = { id }
373369 containerRef = { motionRef }
374370 prefixCls = { prefixCls }
375- className = { classNames ( className , drawerClassNames ?. section ) }
376- style = { {
377- ...style ,
378- ...styles ?. section ,
379- } }
371+ className = { clsx ( className , drawerClassNames ?. section ) }
372+ style = { { ...style , ...styles ?. section } }
380373 { ...pickAttrs ( props , { aria : true } ) }
381374 { ...eventHandlers }
382375 >
@@ -386,17 +379,13 @@ const DrawerPopup: React.ForwardRefRenderFunction<
386379 return (
387380 < div
388381 ref = { wrapperRef }
389- className = { classNames (
382+ className = { clsx (
390383 `${ prefixCls } -content-wrapper` ,
391384 isDragging && `${ prefixCls } -content-wrapper-dragging` ,
392385 drawerClassNames ?. wrapper ,
393386 ! isDragging && motionClassName ,
394387 ) }
395- style = { {
396- ...motionStyle ,
397- ...wrapperStyle ,
398- ...styles ?. wrapper ,
399- } }
388+ style = { { ...motionStyle , ...wrapperStyle , ...styles ?. wrapper } }
400389 { ...pickAttrs ( props , { data : true } ) }
401390 >
402391 { isResizable && < div { ...dragElementProps } /> }
@@ -419,15 +408,10 @@ const DrawerPopup: React.ForwardRefRenderFunction<
419408 return (
420409 < DrawerContext . Provider value = { mergedContext } >
421410 < div
422- className = { classNames (
423- prefixCls ,
424- `${ prefixCls } -${ placement } ` ,
425- rootClassName ,
426- {
427- [ `${ prefixCls } -open` ] : open ,
428- [ `${ prefixCls } -inline` ] : inline ,
429- } ,
430- ) }
411+ className = { clsx ( prefixCls , `${ prefixCls } -${ placement } ` , rootClassName , {
412+ [ `${ prefixCls } -open` ] : open ,
413+ [ `${ prefixCls } -inline` ] : inline ,
414+ } ) }
431415 style = { containerStyle }
432416 tabIndex = { - 1 }
433417 ref = { panelRef }
0 commit comments