this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Remove BaseLink component (#5682)

* Remove BaseLink component

* Fix StarterPackCard Link component

* Rm flex_1 causing overflow

* Make newskie usage full width

authored by

Eric Bailey and committed by
GitHub
0d5af050 7ca1789d

+7 -53
+1 -48
src/components/Link.tsx
··· 1 1 import React from 'react' 2 - import { 3 - GestureResponderEvent, 4 - Pressable, 5 - StyleProp, 6 - ViewStyle, 7 - } from 'react-native' 2 + import {GestureResponderEvent} from 'react-native' 8 3 import {sanitizeUrl} from '@braintree/sanitize-url' 9 4 import {StackActions, useLinkProps} from '@react-navigation/native' 10 5 ··· 346 341 return false 347 342 }, 348 343 } 349 - } 350 - 351 - /** 352 - * A Pressable that uses useLink to handle navigation. It is unstyled, so can be used in cases where the Button styles 353 - * in Link are not desired. 354 - * @param displayText 355 - * @param style 356 - * @param children 357 - * @param rest 358 - * @constructor 359 - */ 360 - export function BaseLink({ 361 - displayText, 362 - onPress: onPressOuter, 363 - style, 364 - children, 365 - ...rest 366 - }: { 367 - style?: StyleProp<ViewStyle> 368 - children: React.ReactNode 369 - to: string 370 - action: 'push' | 'replace' | 'navigate' 371 - onPress?: () => false | void 372 - shareOnLongPress?: boolean 373 - label: string 374 - displayText?: string 375 - }) { 376 - const {onPress, ...btnProps} = useLink({ 377 - displayText: displayText ?? rest.to, 378 - ...rest, 379 - }) 380 - return ( 381 - <Pressable 382 - style={style} 383 - onPress={e => { 384 - onPressOuter?.() 385 - onPress(e) 386 - }} 387 - {...btnProps}> 388 - {children} 389 - </Pressable> 390 - ) 391 344 } 392 345 393 346 export function WebOnlyInlineLinkText({
+1 -1
src/components/NewskieDialog.tsx
··· 127 127 }}> 128 128 <View 129 129 style={[ 130 - a.flex_1, 130 + a.w_full, 131 131 a.mt_sm, 132 132 a.p_lg, 133 133 a.border,
+5 -4
src/components/StarterPack/StarterPackCard.tsx
··· 13 13 import {useSession} from '#/state/session' 14 14 import {atoms as a, useTheme} from '#/alf' 15 15 import {StarterPack} from '#/components/icons/StarterPack' 16 - import {BaseLink} from '#/components/Link' 16 + import {Link as BaseLink, LinkProps as BaseLinkProps} from '#/components/Link' 17 17 import {Text} from '#/components/Typography' 18 18 19 19 export function Default({ ··· 62 62 } 63 63 64 64 return ( 65 - <View style={[a.flex_1, a.gap_md]}> 65 + <View style={[a.w_full, a.gap_md]}> 66 66 <View style={[a.flex_row, a.gap_sm]}> 67 67 {!noIcon ? <StarterPack width={40} gradient="sky" /> : null} 68 68 <View> ··· 96 96 }: { 97 97 starterPack: AppBskyGraphDefs.StarterPackViewBasic 98 98 onPress?: () => void 99 - children: React.ReactNode 99 + children: BaseLinkProps['children'] 100 100 }) { 101 101 const {_} = useLingui() 102 102 const queryClient = useQueryClient() ··· 123 123 starterPack.creator.did, 124 124 ) 125 125 precacheStarterPack(queryClient, starterPack) 126 - }}> 126 + }} 127 + style={[a.flex_col, a.align_start]}> 127 128 {children} 128 129 </BaseLink> 129 130 )