Skip to content

Commit

Permalink
feat(Modal Component): add prop types
Browse files Browse the repository at this point in the history
  • Loading branch information
aliaghdam committed Oct 27, 2024
1 parent 4af14b0 commit 0439c8f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
16 changes: 14 additions & 2 deletions packages/controls/js/libs/modal/index.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,29 @@
//@flow

/**
* WordPress dependencies
* External dependencies
*/
import type { MixedElement } from 'react';
import { __ } from '@wordpress/i18n';
import { Modal as WPModal } from '@wordpress/components';

/**
* Blockera dependencies
*/
import { componentClassNames } from '@blockera/classnames';

/**
* Internal dependencies
*/
import type { ModalProps } from './type';

export default function Modal({
children,
headerIcon,
headerTitle,
className,
...props
}) {
}: ModalProps): MixedElement {
return (
<WPModal
className={componentClassNames('modal', className)}
Expand Down
12 changes: 12 additions & 0 deletions packages/controls/js/libs/modal/type/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
//@flow

export type ModalProps = {
children?: any,
visible?: boolean,
onClose?: () => void,
onRequestClose?: () => void,
headerIcon?: any,
headerTitle?: string,
className?: string,
size?: 'small' | 'medium' | 'large' | 'fill',
};

0 comments on commit 0439c8f

Please sign in to comment.