Page MenuHomePhabricator

D4609.diff
No OneTemporary

D4609.diff

diff --git a/web/modals/threads/sidebars/sidebar-list.react.js b/web/modals/threads/sidebars/sidebar-list.react.js
new file mode 100644
--- /dev/null
+++ b/web/modals/threads/sidebars/sidebar-list.react.js
@@ -0,0 +1,39 @@
+// @flow
+
+import * as React from 'react';
+
+import type { ChatThreadItem } from 'lib/selectors/chat-selectors';
+
+import Sidebar from './sidebar.react';
+import css from './sidebars-modal.css';
+
+type Props = {
+ +sidebars: $ReadOnlyArray<ChatThreadItem>,
+};
+
+function SidebarList(props: Props): React.Node {
+ const { sidebars } = props;
+
+ const sidebarItems = React.useMemo(
+ () =>
+ sidebars.map((sidebarChatItem, idx, sidebarArray) => (
+ <Sidebar
+ sidebar={sidebarChatItem}
+ key={sidebarChatItem.threadInfo.id}
+ isLastItem={idx === sidebarArray.length - 1}
+ />
+ )),
+ [sidebars],
+ );
+
+ if (sidebars.length === 0) {
+ return (
+ <div className={css.noSidebars}>
+ No matching threads were found in the chat.
+ </div>
+ );
+ }
+ return <div className={css.sidebarList}>{sidebarItems}</div>;
+}
+
+export default SidebarList;
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
@@ -1,3 +1,14 @@
+div.sidebarList {
+ overflow: auto;
+ color: var(--sidebars-modal-color);
+}
+
+div.noSidebars {
+ padding: 16px;
+ text-align: center;
+ color: var(--sidebars-modal-color);
+}
+
button.sidebarContainer {
cursor: pointer;
display: flex;
diff --git a/web/theme.css b/web/theme.css
--- a/web/theme.css
+++ b/web/theme.css
@@ -174,5 +174,6 @@
--thread-creation-search-item-bg-hover: var(--shades-black-80);
--thread-creation-search-item-info-color: var(--shades-black-60);
--chat-message-list-active-border: #5989d6;
+ --sidebars-modal-color: var(--shades-black-60);
--sidebars-modal-color-hover: var(--shades-white-100);
}

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 18, 11:31 PM (22 h, 4 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2536142
Default Alt Text
D4609.diff (1 KB)

Event Timeline