Bluesky app fork with some witchin' additions 馃挮
at readme-update 52 lines 1.2 kB view raw
1import {type StyleProp, type TextStyle} from 'react-native' 2 3import {sanitizeDisplayName} from '#/lib/strings/display-names' 4import {useFeedSourceInfoQuery} from '#/state/queries/feed' 5import {atoms as a, platform} from '#/alf' 6import {WebOnlyInlineLinkText} from '#/components/Link' 7import {LoadingPlaceholder} from './LoadingPlaceholder' 8 9export function FeedNameText({ 10 uri, 11 href, 12 numberOfLines, 13 style, 14}: { 15 uri: string 16 href: string 17 numberOfLines?: number 18 style?: StyleProp<TextStyle> 19}) { 20 const {data, isError} = useFeedSourceInfoQuery({uri}) 21 22 let inner 23 if (data || isError) { 24 const displayName = data?.displayName || uri.split('/').pop() || '' 25 inner = ( 26 <WebOnlyInlineLinkText 27 to={href} 28 label={displayName} 29 style={style} 30 numberOfLines={numberOfLines} 31 emoji> 32 {sanitizeDisplayName(displayName)} 33 </WebOnlyInlineLinkText> 34 ) 35 } else { 36 inner = ( 37 <LoadingPlaceholder 38 width={80} 39 height={8} 40 style={[ 41 a.ml_2xs, 42 platform({ 43 native: [a.mt_2xs], 44 web: [{top: -1}], 45 }), 46 ]} 47 /> 48 ) 49 } 50 51 return inner 52}