diff --git a/src/DrawerPopup.tsx b/src/DrawerPopup.tsx index 144718b..bf6d552 100644 --- a/src/DrawerPopup.tsx +++ b/src/DrawerPopup.tsx @@ -313,8 +313,11 @@ function DrawerPopup(props: DrawerPopupProps, ref: React.Ref) { id={id} containerRef={motionRef} prefixCls={prefixCls} - className={className} - style={style} + className={classNames(className, drawerClassNames?.content)} + style={{ + ...style, + ...styles?.content, + }} {...eventHandlers} > {children} diff --git a/src/inter.ts b/src/inter.ts index 0d40dff..614eddb 100644 --- a/src/inter.ts +++ b/src/inter.ts @@ -1,9 +1,11 @@ export interface DrawerClassNames { mask?: string; wrapper?: string; + content?: string; } export interface DrawerStyles { mask?: React.CSSProperties; wrapper?: React.CSSProperties; + content?: React.CSSProperties; } \ No newline at end of file diff --git a/tests/index.spec.tsx b/tests/index.spec.tsx index 5a54aa3..e4d89c4 100755 --- a/tests/index.spec.tsx +++ b/tests/index.spec.tsx @@ -401,6 +401,7 @@ describe('rc-drawer-menu', () => { ); expect( @@ -409,6 +410,9 @@ describe('rc-drawer-menu', () => { expect( document.querySelector('.rc-drawer-mask') ).toHaveClass('customer-mask'); + expect( + document.querySelector('.rc-drawer-content') + ).toHaveClass('customer-content'); unmount(); }); it('should support styles', () => { @@ -416,6 +420,7 @@ describe('rc-drawer-menu', () => { ); expect( @@ -424,6 +429,9 @@ describe('rc-drawer-menu', () => { expect( document.querySelector('.rc-drawer-mask') ).toHaveStyle('background: blue'); + expect( + document.querySelector('.rc-drawer-content') + ).toHaveStyle('background: green'); unmount(); }); });