This commit is contained in:
Justin 2022-08-22 13:18:52 -04:00
parent dd0f2fcf5b
commit 18afb586fa
2 changed files with 39 additions and 11 deletions

View file

@ -587,17 +587,22 @@ class MediaGallery extends React.PureComponent {
/> />
)); ));
let warning; let warning, summary;
if (sensitive) { if (sensitive) {
warning = <FormattedMessage id='status.sensitive_warning' defaultMessage='Sensitive content' />; warning = <FormattedMessage id='status.sensitive_warning' defaultMessage='Sensitive content' />;
} else if (inReview) { } else if (inReview) {
// warning = <FormattedMessage id='status.sensitive_warning' defaultMessage='Sensitive content' />; warning = <FormattedMessage id='status.in_review_warning' defaultMessage='Content Under Review' />;
warning = 'Content Under Review';
} else { } else {
warning = <FormattedMessage id='status.media_hidden' defaultMessage='Media hidden' />; warning = <FormattedMessage id='status.media_hidden' defaultMessage='Media hidden' />;
} }
if (inReview) {
summary = <FormattedMessage id='status.in_review_summary.summary' defaultMessage='This Truth has been sent to Moderation for review and is only visible to you.' />;
} else {
summary = <FormattedMessage id='status.sensitive_warning.subtitle' defaultMessage='This content may not be suitable for all audiences.' />;
}
return ( return (
<div className={classNames('media-gallery', { 'media-gallery--compact': compact })} style={sizeData.get('style')} ref={this.handleRef}> <div className={classNames('media-gallery', { 'media-gallery--compact': compact })} style={sizeData.get('style')} ref={this.handleRef}>
<div <div
@ -617,22 +622,40 @@ class MediaGallery extends React.PureComponent {
size='sm' size='sm'
/> />
) : ( ) : (
<button <div
type='button' onClick={(e) => e.stopPropagation()}
onClick={this.handleOpen}
className={ className={
classNames({ classNames({
'backdrop-blur-sm rounded-lg w-full h-full border-0 flex items-center justify-center': true, 'cursor-default backdrop-blur-sm rounded-lg w-full h-full border-0 flex items-center justify-center': true,
'bg-gray-800/75': !inReview, 'bg-gray-800/75': !inReview,
'bg-danger-600/75': inReview, 'bg-danger-600/75': inReview,
}) })
} }
> >
<div className='text-center space-y-4'> <div className='text-center w-3/4 mx-auto space-y-4'>
<div className='space-y-1'> <div className='space-y-1'>
<Text theme='white' weight='semibold'>{warning}</Text> <Text theme='white' weight='semibold'>{warning}</Text>
<Text theme='white' size='sm'> <Text theme='white' size='sm' weight='medium'>
<FormattedMessage id='status.sensitive_warning.subtitle' defaultMessage='This content may not be suitable for all audiences.' /> {summary}
{' '}
<FormattedMessage
id='status.in_review_summary.contact'
defaultMessage='If you believe this is in error please {link}.'
values={{
link: (
<a
className='underline text-inherit'
href='/hello'
>
<FormattedMessage
id='status.in_review_summary.link'
defaultMessage='Contact Support'
/>
</a>
),
}}
/>
</Text> </Text>
</div> </div>
@ -641,11 +664,12 @@ class MediaGallery extends React.PureComponent {
theme='outline' theme='outline'
size='sm' size='sm'
icon={require('@tabler/icons/eye.svg')} icon={require('@tabler/icons/eye.svg')}
onClick={this.handleOpen}
> >
<FormattedMessage id='status.sensitive_warning.action' defaultMessage='Show content' /> <FormattedMessage id='status.sensitive_warning.action' defaultMessage='Show content' />
</Button> </Button>
</div> </div>
</button> </div>
) )
)} )}
</div> </div>

View file

@ -989,6 +989,10 @@
"status.embed": "Embed", "status.embed": "Embed",
"status.favourite": "Like", "status.favourite": "Like",
"status.filtered": "Filtered", "status.filtered": "Filtered",
"status.in_review_warning": "Content Under Review",
"status.in_review_summary.summary": "This Truth has been sent to Moderation for review and is only visible to you.",
"status.in_review_summary.contact": "If you believe this is in error please {link}.",
"status.in_review_summary.link": "Contact Support",
"status.load_more": "Load more", "status.load_more": "Load more",
"status.media_hidden": "Media hidden", "status.media_hidden": "Media hidden",
"status.mention": "Mention @{name}", "status.mention": "Mention @{name}",