mirror of
https://github.com/tooot-app/app
synced 2025-01-23 07:12:02 +01:00
Fixed #541
Mastodon does not offer the functionality to group notifications like Twitter does, therefore the best solution is to collapse more content by default, assuming users roughly remember what they have tooted
This commit is contained in:
parent
36bbe5bdbd
commit
1ece7b3fe3
@ -108,7 +108,10 @@ const TimelineNotifications: React.FC<Props> = ({
|
|||||||
paddingLeft: highlighted ? 0 : StyleConstants.Avatar.M + StyleConstants.Spacing.S
|
paddingLeft: highlighted ? 0 : StyleConstants.Avatar.M + StyleConstants.Spacing.S
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<TimelineContent setSpoilerExpanded={setSpoilerExpanded} />
|
<TimelineContent
|
||||||
|
notificationOwnToot={['favourite', 'reblog'].includes(notification.type)}
|
||||||
|
setSpoilerExpanded={setSpoilerExpanded}
|
||||||
|
/>
|
||||||
<TimelinePoll />
|
<TimelinePoll />
|
||||||
<TimelineAttachment />
|
<TimelineAttachment />
|
||||||
<TimelineCard />
|
<TimelineCard />
|
||||||
|
@ -6,10 +6,11 @@ import { useSelector } from 'react-redux'
|
|||||||
import StatusContext from './Context'
|
import StatusContext from './Context'
|
||||||
|
|
||||||
export interface Props {
|
export interface Props {
|
||||||
|
notificationOwnToot?: boolean
|
||||||
setSpoilerExpanded?: React.Dispatch<React.SetStateAction<boolean>>
|
setSpoilerExpanded?: React.Dispatch<React.SetStateAction<boolean>>
|
||||||
}
|
}
|
||||||
|
|
||||||
const TimelineContent: React.FC<Props> = ({ setSpoilerExpanded }) => {
|
const TimelineContent: React.FC<Props> = ({ notificationOwnToot = false, setSpoilerExpanded }) => {
|
||||||
const { status, highlighted, disableDetails } = useContext(StatusContext)
|
const { status, highlighted, disableDetails } = useContext(StatusContext)
|
||||||
if (!status || typeof status.content !== 'string' || !status.content.length) return null
|
if (!status || typeof status.content !== 'string' || !status.content.length) return null
|
||||||
|
|
||||||
@ -38,7 +39,13 @@ const TimelineContent: React.FC<Props> = ({ setSpoilerExpanded }) => {
|
|||||||
emojis={status.emojis}
|
emojis={status.emojis}
|
||||||
mentions={status.mentions}
|
mentions={status.mentions}
|
||||||
tags={status.tags}
|
tags={status.tags}
|
||||||
numberOfLines={instanceAccount.preferences['reading:expand:spoilers'] ? 999 : 1}
|
numberOfLines={
|
||||||
|
instanceAccount.preferences['reading:expand:spoilers']
|
||||||
|
? notificationOwnToot
|
||||||
|
? 2
|
||||||
|
: 999
|
||||||
|
: 1
|
||||||
|
}
|
||||||
expandHint={t('shared.content.expandHint')}
|
expandHint={t('shared.content.expandHint')}
|
||||||
setSpoilerExpanded={setSpoilerExpanded}
|
setSpoilerExpanded={setSpoilerExpanded}
|
||||||
highlighted={highlighted}
|
highlighted={highlighted}
|
||||||
@ -53,7 +60,7 @@ const TimelineContent: React.FC<Props> = ({ setSpoilerExpanded }) => {
|
|||||||
emojis={status.emojis}
|
emojis={status.emojis}
|
||||||
mentions={status.mentions}
|
mentions={status.mentions}
|
||||||
tags={status.tags}
|
tags={status.tags}
|
||||||
numberOfLines={highlighted ? 999 : undefined}
|
numberOfLines={highlighted ? 999 : notificationOwnToot ? 2 : undefined}
|
||||||
disableDetails={disableDetails}
|
disableDetails={disableDetails}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
Loading…
Reference in New Issue
Block a user