Don't bother showing redundant tooltip on space menu (#11276)

pull/28217/head
Michael Telatynski 2023-07-17 19:36:58 +01:00 committed by GitHub
parent a62b1d1bec
commit 34532fbdd4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 25 additions and 16 deletions

View File

@ -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<IProps> = ({ onVisibilityChange }) => {
let contextMenuButton: JSX.Element = <div className="mx_RoomListHeader_contextLessTitle">{title}</div>;
if (canShowMainMenu) {
const commonProps = {
inputRef: mainMenuHandle,
onClick: openMainMenu,
isExpanded: mainMenuDisplayed,
className: "mx_RoomListHeader_contextMenuButton",
children: title,
};
if (!!activeSpace) {
contextMenuButton = (
<ContextMenuTooltipButton
inputRef={mainMenuHandle}
onClick={openMainMenu}
isExpanded={mainMenuDisplayed}
className="mx_RoomListHeader_contextMenuButton"
title={
activeSpace
? _t("%(spaceName)s menu", { spaceName: spaceName ?? activeSpace.name })
: _t("Home options")
}
>
{title}
</ContextMenuTooltipButton>
<ContextMenuButton
{...commonProps}
label={_t("%(spaceName)s menu", { spaceName: spaceName ?? activeSpace.name })}
/>
);
} else {
contextMenuButton = <ContextMenuTooltipButton {...commonProps} title={_t("Home options")} />;
}
}
return (