Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

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

Fix post-meta truncation on android

+25 -6
+25 -6
src/view/com/util/PostMeta.tsx
··· 20 20 } 21 21 22 22 export function PostMeta(opts: PostMetaOpts) { 23 + let displayName = opts.authorDisplayName || opts.authorHandle 24 + let handle = opts.authorHandle 25 + 26 + // HACK 27 + // Android simply cannot handle the truncation case we need 28 + // so we have to do it manually here 29 + // -prf 30 + if (displayName.length + handle.length > 26) { 31 + if (displayName.length > 26) { 32 + displayName = displayName.slice(0, 23) + '...' 33 + } else { 34 + handle = handle.slice(0, 23 - displayName.length) + '...' 35 + if (handle.endsWith('....')) { 36 + handle = handle.slice(0, -4) + '...' 37 + } 38 + } 39 + } 40 + 23 41 return ( 24 42 <View style={styles.meta}> 25 43 <Link ··· 27 45 href={opts.authorHref} 28 46 title={opts.authorHandle}> 29 47 <Text style={[s.f17, s.bold, s.black]} numberOfLines={1}> 30 - {opts.authorDisplayName || opts.authorHandle} 31 - <Text style={[s.f15, s.gray5, s.normal, s.black]} numberOfLines={1}> 32 - &nbsp;{opts.authorHandle} 33 - </Text> 48 + {displayName} 49 + {handle ? ( 50 + <Text style={[s.f15, s.gray5, s.normal, s.black]}> 51 + &nbsp;{handle} 52 + </Text> 53 + ) : undefined} 34 54 </Text> 35 55 </Link> 36 56 <Text style={[styles.metaItem, s.f15, s.gray5]}> ··· 38 58 </Text> 39 59 <View style={s.flex1} /> 40 60 <PostDropdownBtn 41 - style={styles.metaItem} 61 + style={[styles.metaItem, s.pl5]} 42 62 itemHref={opts.itemHref} 43 63 itemTitle={opts.itemTitle} 44 64 isAuthor={opts.isAuthor} ··· 59 79 }, 60 80 metaItem: { 61 81 paddingRight: 5, 62 - maxWidth: '75%', 63 82 }, 64 83 })