From 34532fbdd40aa84c44689b5f283125d6cb6d6a89 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Mon, 17 Jul 2023 19:36:58 +0100 Subject: [PATCH] Don't bother showing redundant tooltip on space menu (#11276) --- src/components/views/rooms/RoomListHeader.tsx | 41 +++++++++++-------- 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/src/components/views/rooms/RoomListHeader.tsx b/src/components/views/rooms/RoomListHeader.tsx index d1b7019b4a..31ac1ca69e 100644 --- a/src/components/views/rooms/RoomListHeader.tsx +++ b/src/components/views/rooms/RoomListHeader.tsx @@ -45,7 +45,13 @@ import { showCreateNewSubspace, showSpaceInvite, } from "../../../utils/space"; -import { ChevronFace, ContextMenuTooltipButton, useContextMenu, MenuProps } from "../../structures/ContextMenu"; +import { + ChevronFace, + ContextMenuTooltipButton, + useContextMenu, + MenuProps, + ContextMenuButton, +} from "../../structures/ContextMenu"; import { BetaPill } from "../beta/BetaCard"; import IconizedContextMenu, { IconizedContextMenuOption, @@ -390,21 +396,24 @@ const RoomListHeader: React.FC = ({ onVisibilityChange }) => { let contextMenuButton: JSX.Element =
{title}
; if (canShowMainMenu) { - contextMenuButton = ( - - {title} - - ); + const commonProps = { + inputRef: mainMenuHandle, + onClick: openMainMenu, + isExpanded: mainMenuDisplayed, + className: "mx_RoomListHeader_contextMenuButton", + children: title, + }; + + if (!!activeSpace) { + contextMenuButton = ( + + ); + } else { + contextMenuButton = ; + } } return (