Fix RTL text rendering for display names (#4747)
* header display name rtl support * highlighted post rtl * move `NON_BREAKING_SPACE` to an external constant * rtl support in search dropdown * profile card rtl * old profile card rtl * hover card * wizard list card * new chat * account card * chat header * clean up notifications * just force LTR on meta display name
This commit is contained in:
parent
d5503d17de
commit
f8a59e10dd
13 changed files with 41 additions and 23 deletions
|
@ -6,6 +6,8 @@ import {useQueryClient} from '@tanstack/react-query'
|
|||
import {precacheProfile} from '#/state/queries/profile'
|
||||
import {usePalette} from 'lib/hooks/usePalette'
|
||||
import {makeProfileLink} from 'lib/routes/links'
|
||||
import {forceLTR} from 'lib/strings/bidi'
|
||||
import {NON_BREAKING_SPACE} from 'lib/strings/constants'
|
||||
import {sanitizeDisplayName} from 'lib/strings/display-names'
|
||||
import {sanitizeHandle} from 'lib/strings/handles'
|
||||
import {niceDate} from 'lib/strings/time'
|
||||
|
@ -32,8 +34,6 @@ 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
|
||||
|
@ -70,14 +70,12 @@ let PostMeta = (opts: PostMetaOpts): React.ReactNode => {
|
|||
style={[pal.text]}
|
||||
lineHeight={1.2}
|
||||
disableMismatchWarning
|
||||
text={
|
||||
<>
|
||||
{sanitizeDisplayName(
|
||||
displayName,
|
||||
opts.moderation?.ui('displayName'),
|
||||
)}
|
||||
</>
|
||||
}
|
||||
text={forceLTR(
|
||||
sanitizeDisplayName(
|
||||
displayName,
|
||||
opts.moderation?.ui('displayName'),
|
||||
),
|
||||
)}
|
||||
href={profileLink}
|
||||
onBeforePress={onBeforePressAuthor}
|
||||
/>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue