Add text wrapping to profile header (#603)

zio/stable
Ollie H 2023-05-09 10:00:54 -07:00 committed by GitHub
parent d0990e9b49
commit cfdfd8f395
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 2 deletions

View File

@ -30,7 +30,7 @@ import {ProfileHeaderWarnings} from '../util/moderation/ProfileHeaderWarnings'
import {usePalette} from 'lib/hooks/usePalette'
import {useAnalytics} from 'lib/analytics'
import {NavigationProp} from 'lib/routes/types'
import {isDesktopWeb} from 'platform/detection'
import {isDesktopWeb, isNative} from 'platform/detection'
import {FollowState} from 'state/models/cache/my-follows'
import {shareUrl} from 'lib/sharing'
import {formatCount} from '../util/numeric/format'
@ -367,7 +367,7 @@ const ProfileHeaderLoaded = observer(
</Text>
</View>
) : undefined}
<Text style={pal.textLight}>@{view.handle}</Text>
<Text style={[pal.textLight, styles.handle]}>@{view.handle}</Text>
</View>
{!blockHide && (
<>
@ -553,6 +553,15 @@ const styles = StyleSheet.create({
},
title: {lineHeight: 38},
// Word wrapping appears fine on
// mobile but overflows on desktop
handle: isNative
? undefined
: {
// eslint-disable-next-line
wordBreak: 'break-all',
},
handleLine: {
flexDirection: 'row',
marginBottom: 8,