Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3358680
D3615.id11449.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D3615.id11449.diff
View Options
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
@@ -4,11 +4,13 @@
import invariant from 'invariant';
import * as React from 'react';
+import SWMansionIcon, { type Icon } from '../SWMansionIcon.react';
import css from './modal.css';
export type ModalSize = 'small' | 'large';
type Props = {
- +name: string,
+ +name: React.Node,
+ +icon?: Icon,
+onClose: () => void,
+children?: React.Node,
+size?: ModalSize,
@@ -27,7 +29,7 @@
}
render(): React.Node {
- const { size, children, onClose, fixedHeight, name } = this.props;
+ const { size, children, onClose, fixedHeight, name, icon } = this.props;
const overlayClasses = classNames(
css['modal-overlay'],
@@ -41,6 +43,12 @@
const modalClasses = classNames(css['modal'], {
[css['fixed-height-modal']]: fixedHeight,
});
+
+ let headerIcon;
+ if (icon) {
+ headerIcon = <SWMansionIcon size={24} icon={icon} />;
+ }
+
return (
<div
className={overlayClasses}
@@ -55,7 +63,10 @@
<span className={css['modal-close']} onClick={onClose}>
×
</span>
- <h2>{name}</h2>
+ <h2>
+ {headerIcon}
+ {name}
+ </h2>
</div>
{children}
</div>
diff --git a/web/modals/threads/confirm-leave-thread-modal.react.js b/web/modals/threads/confirm-leave-thread-modal.react.js
--- a/web/modals/threads/confirm-leave-thread-modal.react.js
+++ b/web/modals/threads/confirm-leave-thread-modal.react.js
@@ -18,7 +18,7 @@
const { uiName } = threadInfo;
return (
- <Modal name="Confirm leave thread" onClose={onClose}>
+ <Modal name="Leaving channel" icon="warning-circle" onClose={onClose}>
<div className={css['modal-body']}>
<p>
{'Are you sure you want to leave "'}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 25, 5:44 AM (21 h, 18 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2578564
Default Alt Text
D3615.id11449.diff (1 KB)
Attached To
Mode
D3615: [web] [feat] [ENG-716] add icon to modal header
Attached
Detach File
Event Timeline
Log In to Comment