Show handle in recent searches and fix truncation (#4917)
Co-authored-by: Hailey <me@haileyok.com>zio/stable
parent
88f879ffe9
commit
75c19b2dc2
|
@ -894,13 +894,6 @@ let AutocompleteResults = ({
|
||||||
}
|
}
|
||||||
AutocompleteResults = React.memo(AutocompleteResults)
|
AutocompleteResults = React.memo(AutocompleteResults)
|
||||||
|
|
||||||
function truncateText(text: string, maxLength: number) {
|
|
||||||
if (text.length > maxLength) {
|
|
||||||
return text.substring(0, maxLength) + '...'
|
|
||||||
}
|
|
||||||
return text
|
|
||||||
}
|
|
||||||
|
|
||||||
function SearchHistory({
|
function SearchHistory({
|
||||||
searchHistory,
|
searchHistory,
|
||||||
selectedProfiles,
|
selectedProfiles,
|
||||||
|
@ -965,8 +958,10 @@ function SearchHistory({
|
||||||
style={styles.profileAvatar as StyleProp<ImageStyle>}
|
style={styles.profileAvatar as StyleProp<ImageStyle>}
|
||||||
accessibilityIgnoresInvertColors
|
accessibilityIgnoresInvertColors
|
||||||
/>
|
/>
|
||||||
<Text style={[pal.text, styles.profileName]}>
|
<Text
|
||||||
{truncateText(profile.displayName || '', 12)}
|
style={[pal.text, styles.profileName]}
|
||||||
|
numberOfLines={1}>
|
||||||
|
{profile.displayName || profile.handle}
|
||||||
</Text>
|
</Text>
|
||||||
</Link>
|
</Link>
|
||||||
<Pressable
|
<Pressable
|
||||||
|
@ -1118,6 +1113,7 @@ const styles = StyleSheet.create({
|
||||||
borderRadius: 45,
|
borderRadius: 45,
|
||||||
},
|
},
|
||||||
profileName: {
|
profileName: {
|
||||||
|
width: 78,
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
textAlign: 'center',
|
textAlign: 'center',
|
||||||
marginTop: 5,
|
marginTop: 5,
|
||||||
|
|
Loading…
Reference in New Issue