Skip to content

Commit 701e13c

Browse files
authored
fix(web): hide image action tooltip in expanded viewer (#29329)
1 parent 47f2c8d commit 701e13c

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

‎apps/web/src/components/chat/ExpandedImageDialog.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ export const ExpandedImageDialog = memo(function ExpandedImageDialog({
208208
<ChevronLeftIcon className="size-5" />
209209
</Button>
210210
)}
211-
<MediaActions source={actionsSource}>
211+
<MediaActions source={actionsSource} showTooltip={false}>
212212
<div className="relative isolate z-10 flex max-h-full max-w-[var(--media-width)] flex-col items-center">
213213
{item.type === "video" ? (
214214
<ExpandedVideo key={index} item={item} />

‎apps/web/src/components/media/MediaActions.tsx‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,11 @@ export function useMediaActions(source: MediaActionSource) {
113113
export function MediaActions({
114114
source,
115115
children,
116+
showTooltip = true,
116117
}: {
117118
source: MediaActionSource;
118119
children: ReactElement;
120+
showTooltip?: boolean;
119121
}) {
120122
const { save, copyImage, canReadMedia, assertCanReadMedia } = useMediaActions(source);
121123
const [tooltipOpen, setTooltipOpen] = useState(false);
@@ -204,7 +206,7 @@ export function MediaActions({
204206
};
205207

206208
return (
207-
<Tooltip open={tooltipOpen} onOpenChange={setTooltipOpen}>
209+
<Tooltip disabled={!showTooltip} open={tooltipOpen} onOpenChange={setTooltipOpen}>
208210
<TooltipTrigger
209211
render={children}
210212
tabIndex={0}

0 commit comments

Comments
 (0)