1
- import classNames from 'classnames ' ;
1
+ import { clsx } from 'clsx ' ;
2
2
import type { CSSMotionProps } from '@rc-component/motion' ;
3
3
import CSSMotion from '@rc-component/motion' ;
4
4
import KeyCode from '@rc-component/util/lib/KeyCode' ;
@@ -248,17 +248,13 @@ const DrawerPopup: React.ForwardRefRenderFunction<
248
248
maskRef ,
249
249
) => (
250
250
< div
251
- className = { classNames (
251
+ className = { clsx (
252
252
`${ prefixCls } -mask` ,
253
253
motionMaskClassName ,
254
254
drawerClassNames ?. mask ,
255
255
maskClassName ,
256
256
) }
257
- style = { {
258
- ...motionMaskStyle ,
259
- ...maskStyle ,
260
- ...styles ?. mask ,
261
- } }
257
+ style = { { ...motionMaskStyle , ...maskStyle , ...styles ?. mask } }
262
258
onClick = { maskClosable && open ? onClose : undefined }
263
259
ref = { maskRef }
264
260
/>
@@ -372,11 +368,8 @@ const DrawerPopup: React.ForwardRefRenderFunction<
372
368
id = { id }
373
369
containerRef = { motionRef }
374
370
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 } }
380
373
{ ...pickAttrs ( props , { aria : true } ) }
381
374
{ ...eventHandlers }
382
375
>
@@ -386,17 +379,13 @@ const DrawerPopup: React.ForwardRefRenderFunction<
386
379
return (
387
380
< div
388
381
ref = { wrapperRef }
389
- className = { classNames (
382
+ className = { clsx (
390
383
`${ prefixCls } -content-wrapper` ,
391
384
isDragging && `${ prefixCls } -content-wrapper-dragging` ,
392
385
drawerClassNames ?. wrapper ,
393
386
! isDragging && motionClassName ,
394
387
) }
395
- style = { {
396
- ...motionStyle ,
397
- ...wrapperStyle ,
398
- ...styles ?. wrapper ,
399
- } }
388
+ style = { { ...motionStyle , ...wrapperStyle , ...styles ?. wrapper } }
400
389
{ ...pickAttrs ( props , { data : true } ) }
401
390
>
402
391
{ isResizable && < div { ...dragElementProps } /> }
@@ -419,15 +408,10 @@ const DrawerPopup: React.ForwardRefRenderFunction<
419
408
return (
420
409
< DrawerContext . Provider value = { mergedContext } >
421
410
< 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
+ } ) }
431
415
style = { containerStyle }
432
416
tabIndex = { - 1 }
433
417
ref = { panelRef }
0 commit comments