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/NewskieDialog.tsx b/src/components/NewskieDialog.tsx index 0e35206586..6b02f88c6c 100644 --- a/src/components/NewskieDialog.tsx +++ b/src/components/NewskieDialog.tsx @@ -127,7 +127,7 @@ export function NewskieDialog({ }}> + {!noIcon ? : null} @@ -96,7 +96,7 @@ export function Link({ }: { starterPack: AppBskyGraphDefs.StarterPackViewBasic onPress?: () => void - children: React.ReactNode + children: BaseLinkProps['children'] }) { const {_} = useLingui() const queryClient = useQueryClient() @@ -123,7 +123,8 @@ export function Link({ starterPack.creator.did, ) precacheStarterPack(queryClient, starterPack) - }}> + }} + style={[a.flex_col, a.align_start]}> {children} )