Skip to content

Commit

Permalink
add hedaer, footer & body props
Browse files Browse the repository at this point in the history
  • Loading branch information
joduplessis committed Jun 12, 2024
1 parent 6af612a commit 96e241a
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions packages/core/src/modal/modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ export type ModalAnchor =
| 'bottom-right'

export type ModalProps = {
headerProps?: any
footerProps?: any
bodyProps?: any
dismissOnEscape?: boolean
focusTrap?: boolean
anchor?: ModalAnchor
Expand All @@ -45,6 +48,9 @@ export type ModalProps = {

export const Modal = (props: ModalProps) => {
const {
headerProps = {},
footerProps = {},
bodyProps = {},
dismissOnEscape,
focusTrap = false,
anchor = 'middle-center',
Expand Down Expand Up @@ -113,9 +119,9 @@ export const Modal = (props: ModalProps) => {
tabIndex={0}
onKeyDown={handleKeyDown}
ref={contentRef}>
{header && <div className="f-modal__header f-row">{header}</div>}
{props.children && <div className="f-modal__body">{props.children}</div>}
{footer && <div className="f-modal__footer f-row">{footer}</div>}
{header && <div className="f-modal__header f-row" {...headerProps}>{header}</div>}
{props.children && <div className="f-modal__body" {...bodyProps}>{props.children}</div>}
{footer && <div className="f-modal__footer f-row" {...footerProps}>{footer}</div>}
</View>
</div>
)
Expand Down

0 comments on commit 96e241a

Please sign in to comment.