mirror of
https://github.com/tooot-app/app
synced 2025-05-12 07:49:19 +02:00
Use account preference's spoiler expansion setting
This commit is contained in:
parent
dbabacc202
commit
3d481624ad
@ -1,6 +1,8 @@
|
|||||||
import { ParseHTML } from '@components/Parse'
|
import { ParseHTML } from '@components/Parse'
|
||||||
|
import { getInstanceAccount } from '@utils/slices/instancesSlice'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
|
import { useSelector } from 'react-redux'
|
||||||
|
|
||||||
export interface Props {
|
export interface Props {
|
||||||
status: Mastodon.Status
|
status: Mastodon.Status
|
||||||
@ -17,6 +19,7 @@ const TimelineContent = React.memo(
|
|||||||
disableDetails = false
|
disableDetails = false
|
||||||
}: Props) => {
|
}: Props) => {
|
||||||
const { t } = useTranslation('componentTimeline')
|
const { t } = useTranslation('componentTimeline')
|
||||||
|
const instanceAccount = useSelector(getInstanceAccount, () => true)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@ -41,7 +44,9 @@ const TimelineContent = React.memo(
|
|||||||
emojis={status.emojis}
|
emojis={status.emojis}
|
||||||
mentions={status.mentions}
|
mentions={status.mentions}
|
||||||
tags={status.tags}
|
tags={status.tags}
|
||||||
numberOfLines={1}
|
numberOfLines={
|
||||||
|
instanceAccount.preferences['reading:expand:spoilers'] ? 999 : 1
|
||||||
|
}
|
||||||
expandHint={t('shared.content.expandHint')}
|
expandHint={t('shared.content.expandHint')}
|
||||||
highlighted={highlighted}
|
highlighted={highlighted}
|
||||||
disableDetails={disableDetails}
|
disableDetails={disableDetails}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user