Page MenuHomePhabricator

D3616.id11473.diff
No OneTemporary

D3616.id11473.diff

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
@@ -12,6 +12,7 @@
+name: React.Node,
+icon?: Icon,
+onClose: () => void,
+ +withCloseButton?: boolean,
+children?: React.Node,
+size?: ModalSize,
+fixedHeight?: boolean,
@@ -29,7 +30,15 @@
}
render(): React.Node {
- const { size, children, onClose, fixedHeight, name, icon } = this.props;
+ const {
+ size,
+ children,
+ onClose,
+ fixedHeight,
+ name,
+ icon,
+ withCloseButton = false,
+ } = this.props;
const overlayClasses = classNames(
css['modal-overlay'],
@@ -49,6 +58,15 @@
headerIcon = <SWMansionIcon size={24} icon={icon} />;
}
+ let cornerCloseButton;
+ if (withCloseButton) {
+ cornerCloseButton = (
+ <span className={css['modal-close']} onClick={onClose}>
+ <SWMansionIcon size={24} icon="cross" />
+ </span>
+ );
+ }
+
return (
<div
className={overlayClasses}
@@ -60,9 +78,7 @@
<div className={modalContainerClasses}>
<div className={modalClasses}>
<div className={css['modal-header']}>
- <span className={css['modal-close']} onClick={onClose}>
- ×
- </span>
+ {cornerCloseButton}
<h2>
{headerIcon}
{name}

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 25, 8:37 AM (20 h, 17 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2578585
Default Alt Text
D3616.id11473.diff (1 KB)

Event Timeline