Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 34532fb

Browse files
authored
Don't bother showing redundant tooltip on space menu (#11276)
1 parent a62b1d1 commit 34532fb

File tree

1 file changed

+25
-16
lines changed

1 file changed

+25
-16
lines changed

src/components/views/rooms/RoomListHeader.tsx

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,13 @@ import {
4545
showCreateNewSubspace,
4646
showSpaceInvite,
4747
} from "../../../utils/space";
48-
import { ChevronFace, ContextMenuTooltipButton, useContextMenu, MenuProps } from "../../structures/ContextMenu";
48+
import {
49+
ChevronFace,
50+
ContextMenuTooltipButton,
51+
useContextMenu,
52+
MenuProps,
53+
ContextMenuButton,
54+
} from "../../structures/ContextMenu";
4955
import { BetaPill } from "../beta/BetaCard";
5056
import IconizedContextMenu, {
5157
IconizedContextMenuOption,
@@ -390,21 +396,24 @@ const RoomListHeader: React.FC<IProps> = ({ onVisibilityChange }) => {
390396

391397
let contextMenuButton: JSX.Element = <div className="mx_RoomListHeader_contextLessTitle">{title}</div>;
392398
if (canShowMainMenu) {
393-
contextMenuButton = (
394-
<ContextMenuTooltipButton
395-
inputRef={mainMenuHandle}
396-
onClick={openMainMenu}
397-
isExpanded={mainMenuDisplayed}
398-
className="mx_RoomListHeader_contextMenuButton"
399-
title={
400-
activeSpace
401-
? _t("%(spaceName)s menu", { spaceName: spaceName ?? activeSpace.name })
402-
: _t("Home options")
403-
}
404-
>
405-
{title}
406-
</ContextMenuTooltipButton>
407-
);
399+
const commonProps = {
400+
inputRef: mainMenuHandle,
401+
onClick: openMainMenu,
402+
isExpanded: mainMenuDisplayed,
403+
className: "mx_RoomListHeader_contextMenuButton",
404+
children: title,
405+
};
406+
407+
if (!!activeSpace) {
408+
contextMenuButton = (
409+
<ContextMenuButton
410+
{...commonProps}
411+
label={_t("%(spaceName)s menu", { spaceName: spaceName ?? activeSpace.name })}
412+
/>
413+
);
414+
} else {
415+
contextMenuButton = <ContextMenuTooltipButton {...commonProps} title={_t("Home options")} />;
416+
}
408417
}
409418

410419
return (

0 commit comments

Comments
 (0)