mirror of
https://github.com/tooot-app/app
synced 2025-06-05 22:19:13 +02:00
Fix #631
This commit is contained in:
@ -3,10 +3,9 @@ import CustomText from '@components/Text'
|
||||
import { usePreferencesQuery } from '@utils/queryHooks/preferences'
|
||||
import { StyleConstants } from '@utils/styles/constants'
|
||||
import { useTheme } from '@utils/styles/ThemeManager'
|
||||
import i18next from 'i18next'
|
||||
import React, { useContext } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { Platform, View } from 'react-native'
|
||||
import { View } from 'react-native'
|
||||
import StatusContext from './Context'
|
||||
|
||||
export interface Props {
|
||||
@ -23,11 +22,6 @@ const TimelineContent: React.FC<Props> = ({ notificationOwnToot = false, setSpoi
|
||||
|
||||
const { data: preferences } = usePreferencesQuery()
|
||||
|
||||
const isRTLiOSTextStyles =
|
||||
Platform.OS === 'ios' && status.language && i18next.dir(status.language) === 'rtl'
|
||||
? ({ writingDirection: 'rtl' } as { writingDirection: 'rtl' })
|
||||
: undefined
|
||||
|
||||
return (
|
||||
<View>
|
||||
{status.spoiler_text?.length ? (
|
||||
@ -36,13 +30,7 @@ const TimelineContent: React.FC<Props> = ({ notificationOwnToot = false, setSpoi
|
||||
content={status.spoiler_text}
|
||||
size={highlighted ? 'L' : 'M'}
|
||||
adaptiveSize
|
||||
emojis={status.emojis}
|
||||
mentions={status.mentions}
|
||||
tags={status.tags}
|
||||
numberOfLines={999}
|
||||
highlighted={highlighted}
|
||||
disableDetails={disableDetails}
|
||||
textStyles={isRTLiOSTextStyles}
|
||||
/>
|
||||
{inThread ? (
|
||||
<CustomText
|
||||
@ -60,9 +48,6 @@ const TimelineContent: React.FC<Props> = ({ notificationOwnToot = false, setSpoi
|
||||
content={status.content}
|
||||
size={highlighted ? 'L' : 'M'}
|
||||
adaptiveSize
|
||||
emojis={status.emojis}
|
||||
mentions={status.mentions}
|
||||
tags={status.tags}
|
||||
numberOfLines={
|
||||
preferences?.['reading:expand:spoilers'] || inThread
|
||||
? notificationOwnToot
|
||||
@ -72,9 +57,6 @@ const TimelineContent: React.FC<Props> = ({ notificationOwnToot = false, setSpoi
|
||||
}
|
||||
expandHint={t('shared.content.expandHint')}
|
||||
setSpoilerExpanded={setSpoilerExpanded}
|
||||
highlighted={highlighted}
|
||||
disableDetails={disableDetails}
|
||||
textStyles={isRTLiOSTextStyles}
|
||||
/>
|
||||
</>
|
||||
) : (
|
||||
@ -82,12 +64,7 @@ const TimelineContent: React.FC<Props> = ({ notificationOwnToot = false, setSpoi
|
||||
content={status.content}
|
||||
size={highlighted ? 'L' : 'M'}
|
||||
adaptiveSize
|
||||
emojis={status.emojis}
|
||||
mentions={status.mentions}
|
||||
tags={status.tags}
|
||||
numberOfLines={highlighted || inThread ? 999 : notificationOwnToot ? 2 : undefined}
|
||||
disableDetails={disableDetails}
|
||||
textStyles={isRTLiOSTextStyles}
|
||||
/>
|
||||
)}
|
||||
</View>
|
||||
|
Reference in New Issue
Block a user