diff options
author | Eric Bailey <git@esb.lol> | 2024-10-17 14:35:45 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-17 14:35:45 -0500 |
commit | 0d5af050d3c90172a07486961ea1180b240813ef (patch) | |
tree | 8acef38e6cb7939a02f0b177cc125127155d2661 /src/components/Link.tsx | |
parent | 7ca1789d6f17c99f718ea1a7c1aa838307e72b6d (diff) | |
download | voidsky-0d5af050d3c90172a07486961ea1180b240813ef.tar.zst |
Remove BaseLink component (#5682)
* Remove BaseLink component * Fix StarterPackCard Link component * Rm flex_1 causing overflow * Make newskie usage full width
Diffstat (limited to 'src/components/Link.tsx')
-rw-r--r-- | src/components/Link.tsx | 49 |
1 files changed, 1 insertions, 48 deletions
diff --git a/src/components/Link.tsx b/src/components/Link.tsx index 010299dfb..054a543c1 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<ViewStyle> - 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 ( - <Pressable - style={style} - onPress={e => { - onPressOuter?.() - onPress(e) - }} - {...btnProps}> - {children} - </Pressable> - ) -} - export function WebOnlyInlineLinkText({ children, to, |