Skip to content

Commit

Permalink
Show handle in recent searches and fix truncation (#4917)
Browse files Browse the repository at this point in the history
Co-authored-by: Hailey <[email protected]>
  • Loading branch information
rolandcrosby and haileyok authored Aug 11, 2024
1 parent 88f879f commit 75c19b2
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/view/screens/Search/Search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -894,13 +894,6 @@ let AutocompleteResults = ({
}
AutocompleteResults = React.memo(AutocompleteResults)

function truncateText(text: string, maxLength: number) {
if (text.length > maxLength) {
return text.substring(0, maxLength) + '...'
}
return text
}

function SearchHistory({
searchHistory,
selectedProfiles,
Expand Down Expand Up @@ -965,8 +958,10 @@ function SearchHistory({
style={styles.profileAvatar as StyleProp<ImageStyle>}
accessibilityIgnoresInvertColors
/>
<Text style={[pal.text, styles.profileName]}>
{truncateText(profile.displayName || '', 12)}
<Text
style={[pal.text, styles.profileName]}
numberOfLines={1}>
{profile.displayName || profile.handle}
</Text>
</Link>
<Pressable
Expand Down Expand Up @@ -1118,6 +1113,7 @@ const styles = StyleSheet.create({
borderRadius: 45,
},
profileName: {
width: 78,
fontSize: 12,
textAlign: 'center',
marginTop: 5,
Expand Down

0 comments on commit 75c19b2

Please sign in to comment.