Skip to content

Commit

Permalink
feat(settings-form): add DrawerSetter's trigger props (#122)
Browse files Browse the repository at this point in the history
  • Loading branch information
nekic authored Nov 5, 2021
1 parent 7eb5556 commit 003de57
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ import { createPortal } from 'react-dom'
import { observer, useField } from '@formily/react'
import { FormLayout } from '@formily/antd'
import { IconWidget, usePrefix, useTreeNode } from '@designable/react'
import { Button } from 'antd'
import { Button, ButtonProps } from 'antd'
import cls from 'classnames'
import './styles.less'

export interface IDrawerSetterProps {
text: React.ReactNode
triggerProps: ButtonProps
}

export const DrawerSetter: React.FC<IDrawerSetterProps> = observer((props) => {
Expand Down Expand Up @@ -73,7 +74,7 @@ export const DrawerSetter: React.FC<IDrawerSetterProps> = observer((props) => {

return (
<Fragment>
<Button block onClick={handleOpen}>
<Button block onClick={handleOpen} {...props.triggerProps}>
{props.text || field.title}
</Button>
{renderDrawer()}
Expand Down

0 comments on commit 003de57

Please sign in to comment.