diff --git a/src/components/Link.tsx b/src/components/Link.tsx index 010299dfba..054a543c19 100644 --- a/src/components/Link.tsx +++ b/src/components/Link.tsx @@ -1,10 +1,5 @@ import React from 'react' -import { - GestureResponderEvent, - Pressable, - StyleProp, - ViewStyle, -} from 'react-native' +import {GestureResponderEvent} from 'react-native' import {sanitizeUrl} from '@braintree/sanitize-url' import {StackActions, useLinkProps} from '@react-navigation/native' @@ -348,48 +343,6 @@ export function createStaticClick( } } -/** - * A Pressable that uses useLink to handle navigation. It is unstyled, so can be used in cases where the Button styles - * in Link are not desired. - * @param displayText - * @param style - * @param children - * @param rest - * @constructor - */ -export function BaseLink({ - displayText, - onPress: onPressOuter, - style, - children, - ...rest -}: { - style?: StyleProp - children: React.ReactNode - to: string - action: 'push' | 'replace' | 'navigate' - onPress?: () => false | void - shareOnLongPress?: boolean - label: string - displayText?: string -}) { - const {onPress, ...btnProps} = useLink({ - displayText: displayText ?? rest.to, - ...rest, - }) - return ( - { - onPressOuter?.() - onPress(e) - }} - {...btnProps}> - {children} - - ) -} - export function WebOnlyInlineLinkText({ children, to, diff --git a/src/components/StarterPack/StarterPackCard.tsx b/src/components/StarterPack/StarterPackCard.tsx index ead9c92480..4e4889fa09 100644 --- a/src/components/StarterPack/StarterPackCard.tsx +++ b/src/components/StarterPack/StarterPackCard.tsx @@ -13,7 +13,7 @@ import {precacheStarterPack} from '#/state/queries/starter-packs' import {useSession} from '#/state/session' import {atoms as a, useTheme} from '#/alf' import {StarterPack} from '#/components/icons/StarterPack' -import {BaseLink} from '#/components/Link' +import {Link as BaseLink, LinkProps as BaseLinkProps} from '#/components/Link' import {Text} from '#/components/Typography' export function Default({ @@ -96,7 +96,7 @@ export function Link({ }: { starterPack: AppBskyGraphDefs.StarterPackViewBasic onPress?: () => void - children: React.ReactNode + children: BaseLinkProps['children'] }) { const {_} = useLingui() const queryClient = useQueryClient()