Change how content warnings and filters are displayed in web UI (#31365)

This commit is contained in:
Eugen Rochko 2024-08-22 19:12:35 +02:00 committed by GitHub
parent 98237207e6
commit 500f4925a5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 281 additions and 141 deletions

View file

@ -10,6 +10,7 @@ import ImmutablePureComponent from 'react-immutable-pure-component';
import AlternateEmailIcon from '@/material-icons/400-24px/alternate_email.svg?react';
import { AnimatedNumber } from 'mastodon/components/animated_number';
import { ContentWarning } from 'mastodon/components/content_warning';
import EditedTimestamp from 'mastodon/components/edited_timestamp';
import { getHashtagBarForStatus } from 'mastodon/components/hashtag_bar';
import { Icon } from 'mastodon/components/icon';
@ -277,17 +278,20 @@ class DetailedStatus extends ImmutablePureComponent {
<DisplayName account={status.get('account')} localDomain={this.props.domain} />
</a>
<StatusContent
status={status}
expanded={!status.get('hidden')}
onExpandedToggle={this.handleExpandedToggle}
onTranslate={this.handleTranslate}
{...statusContentProps}
/>
{status.get('spoiler_text').length > 0 && <ContentWarning text={status.getIn(['translation', 'spoilerHtml']) || status.get('spoilerHtml')} expanded={expanded} onClick={this.handleExpandedToggle} />}
{media}
{expanded && (
<>
<StatusContent
status={status}
onTranslate={this.handleTranslate}
{...statusContentProps}
/>
{expanded && hashtagBar}
{media}
{hashtagBar}
</>
)}
<div className='detailed-status__meta'>
<div className='detailed-status__meta__line'>