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
@@ -6,6 +6,7 @@
leaveThread,
leaveThreadActionTypes,
} from 'lib/actions/thread-actions';
+import { usePromoteSidebar } from 'lib/hooks/promote-sidebar.react';
import { childThreadInfos } from 'lib/selectors/thread-selectors';
import {
threadHasPermission,
@@ -21,6 +22,7 @@
useServerCall,
useDispatchActionPromise,
} from 'lib/utils/action-utils';
+import { isDev } from 'lib/utils/dev-utils';
import MenuItem from '../components/menu-item.react';
import Menu from '../components/menu.react';
@@ -40,8 +42,8 @@
function ThreadMenu(props: ThreadMenuProps): React.Node {
const { setModal, clearModal } = useModalContext();
-
const { threadInfo } = props;
+ const { onPromoteSidebar } = usePromoteSidebar(threadInfo);
const onClickSettings = React.useCallback(
() => setModal(),
@@ -195,6 +197,17 @@
);
}, [onClickLeaveThread, threadInfo]);
+ const promoteSidebar = React.useMemo(() => {
+ return (
+
+ );
+ }, [onPromoteSidebar]);
+
const menuItems = React.useMemo(() => {
const notificationsItem = (
@@ -204,6 +217,7 @@
// TODO: Enable menu items when the modals are implemented
const SHOW_NOTIFICATIONS = false;
const SHOW_CREATE_SUBCHANNELS = false;
+ const SHOW_PROMOTE_SIDEBAR = isDev;
const items = [
settingsItem,
@@ -213,6 +227,7 @@
viewSubchannelsItem,
SHOW_CREATE_SUBCHANNELS && createSubchannelsItem,
leaveThreadItem && separator,
+ SHOW_PROMOTE_SIDEBAR && promoteSidebar,
leaveThreadItem,
];
return items.filter(Boolean);
@@ -221,6 +236,7 @@
membersItem,
sidebarItem,
viewSubchannelsItem,
+ promoteSidebar,
createSubchannelsItem,
leaveThreadItem,
]);