Skip to content

Commit

Permalink
feat: allow customizable modal size through props
Browse files Browse the repository at this point in the history
  • Loading branch information
yogeshbhutkar committed Feb 25, 2025
1 parent 77da6c2 commit 8898589
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export function ActionModal< Item >( {
__experimentalHideHeader={ !! action.hideModalHeader }
onRequestClose={ closeModal }
focusOnMount="firstContentElement"
size="medium"
size={ action.modalSize || 'medium' }
overlayClassName={ `dataviews-action-modal dataviews-action-modal__${ kebabCase(
action.id
) }` }
Expand Down
5 changes: 5 additions & 0 deletions packages/dataviews/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,11 @@ export interface ActionModal< Item > extends ActionBase< Item > {
* The header of the modal.
*/
modalHeader?: string;

/**
* The size of the modal.
*/
modalSize?: 'small' | 'medium' | 'large' | 'fill';
}

export interface ActionButton< Item > extends ActionBase< Item > {
Expand Down

0 comments on commit 8898589

Please sign in to comment.