1
0
mirror of https://github.com/tooot-app/app synced 2025-06-05 22:19:13 +02:00
Unfortunately iOS does not display RTL languages automatically like Android does, so some simple JS library is needed
This commit is contained in:
xmflsct
2022-12-15 00:03:09 +01:00
parent 4a35e910c1
commit c90c8ee8d4
7 changed files with 28 additions and 2 deletions

View File

@ -13,7 +13,7 @@ import { useTheme } from '@utils/styles/ThemeManager'
import { isEqual } from 'lodash'
import React, { useCallback, useState } from 'react'
import { useTranslation } from 'react-i18next'
import { Platform, Pressable, View } from 'react-native'
import { Platform, Pressable, TextStyleIOS, View } from 'react-native'
import HTMLView from 'react-native-htmlview'
import { useSelector } from 'react-redux'
@ -154,6 +154,7 @@ const renderNode = ({
export interface Props {
content: string
size?: 'S' | 'M' | 'L'
textStyles?: TextStyleIOS
adaptiveSize?: boolean
emojis?: Mastodon.Emoji[]
mentions?: Mastodon.Mention[]
@ -171,6 +172,7 @@ const ParseHTML = React.memo(
({
content,
size = 'M',
textStyles,
adaptiveSize = false,
emojis,
mentions,
@ -294,6 +296,7 @@ const ParseHTML = React.memo(
}
}}
style={{
...textStyles,
height: numberOfLines === 1 && !expanded ? 0 : undefined
}}
numberOfLines={