Page MenuHomePhabricator

D3333.diff
No OneTemporary

D3333.diff

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

Mime Type
text/plain
Expires
Mon, Nov 18, 9:38 AM (22 h, 12 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2534472
Default Alt Text
D3333.diff (1 KB)

Event Timeline