Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3523188
D7275.id24547.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D7275.id24547.diff
View Options
diff --git a/web/modals/threads/sidebars/sidebar.react.js b/web/modals/threads/sidebars/sidebar.react.js
--- a/web/modals/threads/sidebars/sidebar.react.js
+++ b/web/modals/threads/sidebars/sidebar.react.js
@@ -11,6 +11,7 @@
import css from './sidebars-modal.css';
import Button from '../../../components/button.react.js';
+import ThreadAvatar from '../../../components/thread-avatar.react.js';
import { getDefaultTextMessageRules } from '../../../markdown/rules.react.js';
import { useOnClickThread } from '../../../selectors/thread-selectors.js';
@@ -41,6 +42,11 @@
[css.unread]: unread,
});
+ const previewTextClassName = classNames({
+ [css.longTextEllipsis]: true,
+ [css.avatarOffset]: true,
+ });
+
const lastActivity = React.useMemo(
() => shortAbsoluteDate(lastUpdatedTime),
[lastUpdatedTime],
@@ -62,13 +68,14 @@
: message.text;
return (
<>
- <div className={css.longTextEllipsis}>{previewText}</div>
+ <div className={previewTextClassName}>{previewText}</div>
<div className={css.lastActivity}>{lastActivity}</div>
</>
);
- }, [lastActivity, messagePreviewResult]);
+ }, [lastActivity, messagePreviewResult, previewTextClassName]);
const { uiName } = useResolvedThreadInfo(threadInfo);
+
return (
<Button className={css.sidebarContainer} onClick={onClickThread}>
<img
@@ -81,7 +88,10 @@
alt="sidebar arrow"
/>
<div className={sidebarInfoClassName}>
- <div className={css.longTextEllipsis}>{uiName}</div>
+ <div className={css.avatarContainer}>
+ <ThreadAvatar size="micro" threadInfo={threadInfo} />
+ <div className={css.longTextEllipsis}>{uiName}</div>
+ </div>
<div className={css.lastMessage}>{lastMessage}</div>
</div>
</Button>
diff --git a/web/modals/threads/sidebars/sidebars-modal.css b/web/modals/threads/sidebars/sidebars-modal.css
--- a/web/modals/threads/sidebars/sidebars-modal.css
+++ b/web/modals/threads/sidebars/sidebars-modal.css
@@ -41,6 +41,16 @@
padding: 8px 0;
}
+div.avatarContainer {
+ display: flex;
+ align-items: center;
+ gap: 8px;
+}
+
+div.avatarOffset {
+ margin-left: 24px;
+}
+
div.longTextEllipsis {
text-overflow: ellipsis;
overflow: hidden;
diff --git a/web/modals/threads/subchannels/subchannel.react.js b/web/modals/threads/subchannels/subchannel.react.js
--- a/web/modals/threads/subchannels/subchannel.react.js
+++ b/web/modals/threads/subchannels/subchannel.react.js
@@ -4,7 +4,6 @@
import * as React from 'react';
import { useModalContext } from 'lib/components/modal-provider.react.js';
-import SWMansionIcon from 'lib/components/SWMansionIcon.react.js';
import { type ChatThreadItem } from 'lib/selectors/chat-selectors.js';
import { useMessagePreview } from 'lib/shared/message-utils.js';
import { shortAbsoluteDate } from 'lib/utils/date-utils.js';
@@ -12,6 +11,7 @@
import css from './subchannels-modal.css';
import Button from '../../../components/button.react.js';
+import ThreadAvatar from '../../../components/thread-avatar.react.js';
import { getDefaultTextMessageRules } from '../../../markdown/rules.react.js';
import { useOnClickThread } from '../../../selectors/thread-selectors.js';
@@ -74,9 +74,10 @@
}, [lastActivity, messagePreviewResult]);
const { uiName } = useResolvedThreadInfo(threadInfo);
+
return (
<Button className={css.subchannelContainer} onClick={onClickThread}>
- <SWMansionIcon icon="message-square" size={22} />
+ <ThreadAvatar size="small" threadInfo={threadInfo} />
<div className={subchannelTitleClassName}>
<div className={css.longTextEllipsis}>{uiName}</div>
<div className={css.lastMessage}>{lastMessage}</div>
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Dec 24, 8:40 AM (17 h, 10 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2698321
Default Alt Text
D7275.id24547.diff (3 KB)
Attached To
Mode
D7275: [web] render thread avatars in thread subchannel/sidebar modals
Attached
Detach File
Event Timeline
Log In to Comment