From 470539591dd9a4022c725945f596987caa897621 Mon Sep 17 00:00:00 2001 From: Chris Bongers Date: Fri, 29 May 2026 09:27:48 +0200 Subject: [PATCH] chore: fix read inside image click --- .../src/components/post/PostContent.tsx | 24 ++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/packages/shared/src/components/post/PostContent.tsx b/packages/shared/src/components/post/PostContent.tsx index ccc3bac80d..17e4a1f73a 100644 --- a/packages/shared/src/components/post/PostContent.tsx +++ b/packages/shared/src/components/post/PostContent.tsx @@ -27,6 +27,7 @@ import { PostClickbaitShield } from './common/PostClickbaitShield'; import { useSmartTitle } from '../../hooks/post/useSmartTitle'; import { PostTagList } from './tags/PostTagList'; import PostSourceInfo from './PostSourceInfo'; +import { useReaderInstallPromptGate } from '../../hooks/useReaderInstallPromptGate'; type PostContentRawProps = Omit & { post: Post }; @@ -43,9 +44,12 @@ const ArticleLink = ({ onClick, children, ...props -}: ComponentProps<'a'> & { href?: string; onClick?: () => void }) => { +}: ComponentProps<'a'> & { + href?: string; + onClick?: (event: React.MouseEvent) => void; +}) => { const clickHandlers = onClick - ? combinedClicks(() => onClick()) + ? combinedClicks(onClick) : undefined; return ( (onClose as (event?: unknown) => void)() + : undefined, + }, + ); + const handleImageClick = (event: React.MouseEvent) => { + if (onReaderInstallGateClick(event)) { + return; + } + onReadArticle(); + }; const onSendViewPost = useViewPost(); const showCodeSnippets = useFeature(feature.showCodeSnippets); const { title } = useSmartTitle(post); @@ -220,7 +238,7 @@ export function PostContentRaw({ {!isVideoType && (