diff --git a/web/modals/modal.react.js b/web/modals/modal.react.js
--- a/web/modals/modal.react.js
+++ b/web/modals/modal.react.js
@@ -11,7 +11,7 @@
type Props = {
+name: React.Node,
+icon?: Icon,
- +onClose: () => void,
+ +onClose?: () => void,
+children?: React.Node,
+size?: ModalSize,
+fixedHeight?: boolean,
@@ -49,6 +49,15 @@
headerIcon = ;
}
+ let cornerCloseButton;
+ if (onClose) {
+ cornerCloseButton = (
+
+
+
+ );
+ }
+
return (
-
- ×
-
+ {cornerCloseButton}
{headerIcon}
{name}
@@ -83,7 +90,7 @@
event: SyntheticEvent,
) => void = event => {
if (event.target === this.overlay) {
- this.props.onClose();
+ this.props.onClose?.();
}
};
@@ -91,7 +98,7 @@
event: SyntheticKeyboardEvent,
) => void = event => {
if (event.keyCode === 27) {
- this.props.onClose();
+ this.props.onClose?.();
}
};
}