diff --git a/src/bootstrap/Modal.js b/src/bootstrap/Modal.js index 96f1fef..bac17a2 100644 --- a/src/bootstrap/Modal.js +++ b/src/bootstrap/Modal.js @@ -18,6 +18,7 @@ Modal.propTypes = { /** Callback to manage modal visibility */ setShown: PropTypes.func.isRequired, scrollable: PropTypes.bool, + size: PropTypes.string, /** Modal content use following: `ModalHeader`, `ModalBody`, `ModalFooter` */ children: PropTypes.oneOfType([ @@ -26,8 +27,9 @@ Modal.propTypes = { ]).isRequired, }; -export function Modal({ shown, setShown, scrollable, children }) { +export function Modal({ shown, setShown, scrollable, size, children }) { const dialogRef = useRef(); + let modalSize = "modal-"; useClickOutside(dialogRef, () => setShown(false)); @@ -44,14 +46,32 @@ export function Modal({ shown, setShown, scrollable, children }) { }; }, [setShown]); + switch (size) { + case "sm": + modalSize += "sm"; + break; + case "lg": + modalSize += "lg"; + break; + case "xl": + modalSize += "xl"; + break; + default: + modalSize = ""; + break; + } + return ( -
+
{children}