Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F2834079
D7310.id24650.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D7310.id24650.diff
View Options
diff --git a/web/chat/thread-top-bar.css b/web/chat/thread-top-bar.css
--- a/web/chat/thread-top-bar.css
+++ b/web/chat/thread-top-bar.css
@@ -37,3 +37,28 @@
cursor: pointer;
color: var(--thread-top-bar-menu-color);
}
+
+.pinnedCountBanner {
+ background-color: var(--pinned-count-banner-color);
+ height: 40px;
+ text-align: center;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
+
+span.pinnedCountText {
+ color: var(--pinned-count-text-color);
+ font-size: 12px;
+ display: inline-flex;
+ align-items: center;
+}
+
+span.pinnedCountText:hover {
+ cursor: pointer;
+ text-decoration: underline;
+}
+
+.chevronRight {
+ vertical-align: middle;
+}
diff --git a/web/chat/thread-top-bar.react.js b/web/chat/thread-top-bar.react.js
--- a/web/chat/thread-top-bar.react.js
+++ b/web/chat/thread-top-bar.react.js
@@ -1,6 +1,7 @@
// @flow
import * as React from 'react';
+import { ChevronRight } from 'react-feather';
import { threadIsPending } from 'lib/shared/thread-utils.js';
import type { ThreadInfo } from 'lib/types/thread-types.js';
@@ -26,18 +27,39 @@
threadMenu = <ThreadMenu threadInfo={threadInfo} />;
}
+ const pinnedCountBanner = React.useMemo(() => {
+ if (!threadInfo.pinnedCount || threadInfo.pinnedCount === 0) {
+ return null;
+ }
+
+ const singleOrPlural =
+ threadInfo.pinnedCount === 1 ? 'message' : 'messages';
+
+ return (
+ <div className={css.pinnedCountBanner}>
+ <span className={css.pinnedCountText}>
+ {threadInfo.pinnedCount} pinned {singleOrPlural}
+ <ChevronRight size={14} className={css.chevronRight} />
+ </span>
+ </div>
+ );
+ }, [threadInfo.pinnedCount]);
+
const { uiName } = useResolvedThreadInfo(threadInfo);
return (
- <div className={css.topBarContainer}>
- <div className={css.topBarThreadInfo}>
- <div
- className={css.threadColorSquare}
- style={threadBackgroundColorStyle}
- />
- <div className={css.threadTitle}>{uiName}</div>
+ <>
+ <div className={css.topBarContainer}>
+ <div className={css.topBarThreadInfo}>
+ <div
+ className={css.threadColorSquare}
+ style={threadBackgroundColorStyle}
+ />
+ <div className={css.threadTitle}>{uiName}</div>
+ </div>
+ {threadMenu}
</div>
- {threadMenu}
- </div>
+ {pinnedCountBanner}
+ </>
);
}
diff --git a/web/theme.css b/web/theme.css
--- a/web/theme.css
+++ b/web/theme.css
@@ -214,4 +214,6 @@
--topbar-lines: rgba(255, 255, 255, 0.08);
--pin-message-information-text-color: var(--shades-white-60);
--pin-message-modal-border-color: var(--shades-black-80);
+ --pinned-count-banner-color: var(--shades-black-90);
+ --pinned-count-text-color: var(--shades-white-90);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Sep 29, 9:54 AM (16 h, 37 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2200010
Default Alt Text
D7310.id24650.diff (2 KB)
Attached To
Mode
D7310: [web] Display the number of pinned messages in a banner across chat
Attached
Detach File
Event Timeline
Log In to Comment