about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorRoland Crosby <roland@rolandcrosby.com>2024-08-11 19:12:36 -0400
committerGitHub <noreply@github.com>2024-08-11 16:12:36 -0700
commit75c19b2dc21ddc3338a9d7ea590bb3e0e999610f (patch)
tree3dea01ff82ba14f3e07fc448f1783c0517bf08f9 /src
parent88f879ffe91fb7bff668c81b5a82fb4cfbd7889b (diff)
downloadvoidsky-75c19b2dc21ddc3338a9d7ea590bb3e0e999610f.tar.zst
Show handle in recent searches and fix truncation (#4917)
Co-authored-by: Hailey <me@haileyok.com>
Diffstat (limited to 'src')
-rw-r--r--src/view/screens/Search/Search.tsx14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/view/screens/Search/Search.tsx b/src/view/screens/Search/Search.tsx
index 737e4c5c3..30d16506e 100644
--- a/src/view/screens/Search/Search.tsx
+++ b/src/view/screens/Search/Search.tsx
@@ -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,
@@ -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
@@ -1118,6 +1113,7 @@ const styles = StyleSheet.create({
     borderRadius: 45,
   },
   profileName: {
+    width: 78,
     fontSize: 12,
     textAlign: 'center',
     marginTop: 5,