Fix misplaced '@' in RTL post meta. (#4531)

Co-authored-by: Joel <joel.garplind+github@gmail.com>
Co-authored-by: Hailey <me@haileyok.com>
This commit is contained in:
Joel 2024-07-08 00:27:30 +02:00 committed by GitHub
parent ea37298cdd
commit ea7afecf28
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 19 additions and 7 deletions

View file

@ -32,6 +32,8 @@ interface PostMetaOpts {
style?: StyleProp<ViewStyle>
}
const NON_BREAKING_SPACE = '\u00A0'
let PostMeta = (opts: PostMetaOpts): React.ReactNode => {
const pal = usePalette('default')
const displayName = opts.author.displayName || opts.author.handle
@ -83,7 +85,7 @@ let PostMeta = (opts: PostMetaOpts): React.ReactNode => {
type="md"
disableMismatchWarning
style={[pal.textLight, {flexShrink: 4}]}
text={'\xa0' + sanitizeHandle(handle, '@')}
text={NON_BREAKING_SPACE + sanitizeHandle(handle, '@')}
href={profileLink}
onBeforePress={onBeforePressAuthor}
anchorNoUnderline