Skip to content

Commit

Permalink
feat: add drawer content props
Browse files Browse the repository at this point in the history
  • Loading branch information
yuche committed Oct 22, 2021
1 parent c2cf836 commit 62902b5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion libs/mibao-ui/src/lib/drawer/drawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import {
DrawerOverlay,
DrawerContent,
DrawerCloseButton,
DrawerProps as RawDrawerProps
DrawerProps as RawDrawerProps,
DrawerContentProps
} from '@chakra-ui/react'
import styles from './drawer.module.scss'

Expand All @@ -17,6 +18,7 @@ export interface DrawerProps extends RawDrawerProps {
footer?: React.ReactNode
children: React.ReactNode
rounded?: 'none' | 'md' | 'lg' | 'xl'
contentProps?: DrawerContentProps
}

export const Drawer = ({
Expand All @@ -26,6 +28,7 @@ export const Drawer = ({
header,
footer,
children,
contentProps,
...props
}: DrawerProps) => (
<RawDrawer {...props}>
Expand All @@ -34,6 +37,7 @@ export const Drawer = ({
className={styles.content}
data-rounded={rounded}
data-placement={props.placement}
{...contentProps}
>
{hasCloseBtn ? <DrawerCloseButton /> : null}
{header !== undefined ? <DrawerHeader>{header}</DrawerHeader> : null}
Expand Down

1 comment on commit 62902b5

@vercel
Copy link

@vercel vercel bot commented on 62902b5 Oct 22, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.