Do not render tooltip when RA is displayed on TAC (#12472)

This commit is contained in:
Florian Duros
2024-05-01 22:39:08 +02:00
committed by GitHub
parent 5dc3ad546c
commit ad7f626e22
3 changed files with 21 additions and 2 deletions

View File

@@ -26,6 +26,10 @@ import { NotificationLevel } from "../../../../stores/notifications/Notification
import { notificationLevelToIndicator } from "../../../../utils/notifications";
interface ThreadsActivityCentreButtonProps extends ComponentProps<typeof IconButton> {
/**
* Whether to disable the tooltip.
*/
disableTooltip?: boolean;
/**
* Display the `Threads` label next to the icon.
*/
@@ -40,9 +44,12 @@ interface ThreadsActivityCentreButtonProps extends ComponentProps<typeof IconBut
* A button to open the thread activity centre.
*/
export const ThreadsActivityCentreButton = forwardRef<HTMLButtonElement, ThreadsActivityCentreButtonProps>(
function ThreadsActivityCentreButton({ displayLabel, notificationLevel, ...props }, ref): React.JSX.Element {
function ThreadsActivityCentreButton(
{ displayLabel, notificationLevel, disableTooltip, ...props },
ref,
): React.JSX.Element {
// Disable tooltip when the label is displayed
const openTooltip = displayLabel ? false : undefined;
const openTooltip = disableTooltip || displayLabel ? false : undefined;
return (
<Tooltip label={_t("common|threads")} placement="right" open={openTooltip}>