From cc8516ad2a41bb3853b55ea7b7b2ce31accee6f6 Mon Sep 17 00:00:00 2001 From: Oleksii Bulenok Date: Mon, 24 Aug 2026 18:15:42 +0200 Subject: [PATCH] fix nested starterPackCard --- .../Search/components/StarterPackCard.tsx | 25 +++++++++++++------ 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/src/screens/Search/components/StarterPackCard.tsx b/src/screens/Search/components/StarterPackCard.tsx index 5aa9237cd8..633f1668a0 100644 --- a/src/screens/Search/components/StarterPackCard.tsx +++ b/src/screens/Search/components/StarterPackCard.tsx @@ -11,9 +11,9 @@ import {useSession} from '#/state/session' import {LoadingPlaceholder} from '#/view/com/util/LoadingPlaceholder' import {UserAvatar} from '#/view/com/util/UserAvatar' import {atoms as a, useBreakpoints, useTheme, web} from '#/alf' -import {ButtonText} from '#/components/Button' +import {Button, ButtonText} from '#/components/Button' import {PlusSmall_Stroke2_Corner0_Rounded as Plus} from '#/components/icons/Plus' -import {Link} from '#/components/Link' +import {Link, useLink} from '#/components/Link' import {MediaInsetBorder} from '#/components/MediaInsetBorder' import {useStarterPackLink} from '#/components/StarterPack/StarterPackCard' import {SubtleHover} from '#/components/SubtleHover' @@ -33,6 +33,15 @@ export function StarterPackCard({ const {currentAccount} = useSession() const {gtPhone} = useBreakpoints() const link = useStarterPackLink({view}) + + const openPack = useLink({ + to: link.to, + displayText: link.label, + onPress: () => { + link.precache() + onPress?.() + }, + }) const record = view.record const isOwnStarterPack = view.creator?.did === currentAccount?.did @@ -105,13 +114,13 @@ export function StarterPackCard({ : _(msg`By ${sanitizeHandle(view.creator.handle, '@')}`)} - { - link.precache() - onPress?.() + onPress={e => { + // don't let the press reach the surrounding card link + e.stopPropagation() + openPack.onPress(e) }} variant="solid" color="secondary" @@ -120,7 +129,7 @@ export function StarterPackCard({ Open pack - +