Don't display sensitive content overlay when not needed

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
marcin mikołajczak 2024-08-25 23:23:44 +02:00
parent a37d04b300
commit 7ee99288e0
3 changed files with 23 additions and 16 deletions

View file

@ -104,12 +104,12 @@ const QuotedStatus: React.FC<IQuotedStatus> = ({ status, onCancel, compose }) =>
{status.quote_id && <QuotedStatusIndicator statusId={status.quote_id} />} {status.quote_id && <QuotedStatusIndicator statusId={status.quote_id} />}
{status.media_attachments.length > 0 && (
<div className='relative'> <div className='relative'>
<SensitiveContentOverlay status={status} /> <SensitiveContentOverlay status={status} />
{status.media_attachments.length > 0 && (
<StatusMedia status={status} muted={compose} /> <StatusMedia status={status} muted={compose} />
)}
</div> </div>
)}
</Stack> </Stack>
</Stack> </Stack>
)} )}

View file

@ -427,13 +427,17 @@ const Status: React.FC<IStatus> = (props) => {
<TranslateButton status={actualStatus} /> <TranslateButton status={actualStatus} />
{(quote || actualStatus.card || actualStatus.media_attachments.length > 0) && ( {(quote || actualStatus.card || actualStatus.media_attachments.length > 0) && (
<Stack space={4} className='relative'> <Stack space={4}>
{actualStatus.media_attachments.length > 0 && (
<div className='relative'>
<SensitiveContentOverlay status={actualStatus} /> <SensitiveContentOverlay status={actualStatus} />
<StatusMedia <StatusMedia
status={actualStatus} status={actualStatus}
muted={muted} muted={muted}
onClick={handleClick} onClick={handleClick}
/> />
</div>
)}
{quote} {quote}
</Stack> </Stack>

View file

@ -126,10 +126,13 @@ const DetailedStatus: React.FC<IDetailedStatus> = ({
<TranslateButton status={actualStatus} /> <TranslateButton status={actualStatus} />
{(withMedia && (quote || actualStatus.card || actualStatus.media_attachments.length > 0)) && ( {(withMedia && (quote || actualStatus.card || actualStatus.media_attachments.length > 0)) && (
<Stack space={4} className='relative'> <Stack space={4}>
{actualStatus.media_attachments.length > 0 && (
<div className='relative'>
<SensitiveContentOverlay status={status} /> <SensitiveContentOverlay status={status} />
<StatusMedia status={actualStatus} /> <StatusMedia status={actualStatus} />
</div>
)}
{quote} {quote}
</Stack> </Stack>