Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3299372
D3333.id10214.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
D3333.id10214.diff
View Options
diff --git a/web/chat/thread-menu.react.js b/web/chat/thread-menu.react.js
--- a/web/chat/thread-menu.react.js
+++ b/web/chat/thread-menu.react.js
@@ -23,6 +23,7 @@
threadPermissions,
} from 'lib/types/thread-types';
+import SidebarListModal from '../modals/chat/sidebar-list-modal.react';
import { useModalContext } from '../modals/modal-provider.react';
import ThreadSettingsModal from '../modals/threads/thread-settings-modal.react';
import { useSelector } from '../redux/redux-utils';
@@ -74,14 +75,24 @@
);
}, [childThreads]);
+ const onClickSidebars = React.useCallback(
+ () => setModal(<SidebarListModal threadInfo={threadInfo} />),
+ [setModal, threadInfo],
+ );
+
const sidebarItem = React.useMemo(() => {
if (!hasSidebars) {
return null;
}
return (
- <ThreadMenuItem key="sidebars" text="Sidebars" icon={faArrowRight} />
+ <ThreadMenuItem
+ key="sidebars"
+ text="Sidebars"
+ icon={faArrowRight}
+ onClick={onClickSidebars}
+ />
);
- }, [hasSidebars]);
+ }, [hasSidebars, onClickSidebars]);
const canCreateSubchannels = React.useMemo(
() => threadHasPermission(threadInfo, threadPermissions.CREATE_SUBCHANNELS),
@@ -145,7 +156,6 @@
// TODO: Enable menu items when the modals are implemented
const SHOW_NOTIFICATIONS = false;
const SHOW_MEMBERS = false;
- const SHOW_SIDEBAR = false;
const SHOW_VIEW_SUBCHANNELS = false;
const SHOW_CREATE_SUBCHANNELS = false;
const SHOW_LEAVE_THREAD = false;
@@ -154,7 +164,7 @@
settingsItem,
SHOW_NOTIFICATIONS && notificationsItem,
SHOW_MEMBERS && membersItem,
- SHOW_SIDEBAR && sidebarItem,
+ sidebarItem,
SHOW_VIEW_SUBCHANNELS && viewSubchannelsItem,
SHOW_CREATE_SUBCHANNELS && createSubchannelsItem,
SHOW_LEAVE_THREAD && leaveThreadItem && separator,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 18, 11:23 AM (21 h, 18 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2534472
Default Alt Text
D3333.id10214.diff (1 KB)
Attached To
Mode
D3333: [web] Show sidebars modal from thread menu
Attached
Detach File
Event Timeline
Log In to Comment