Change media to be hidden/blurred by default in report modal (#28522)

shrike
Claire 2023-12-29 17:34:13 +01:00 committed by GitHub
parent fcfdeadc04
commit 6374358357
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -15,6 +15,7 @@ export default class MediaAttachments extends ImmutablePureComponent {
lang: PropTypes.string, lang: PropTypes.string,
height: PropTypes.number, height: PropTypes.number,
width: PropTypes.number, width: PropTypes.number,
visible: PropTypes.bool,
}; };
static defaultProps = { static defaultProps = {
@ -51,7 +52,7 @@ export default class MediaAttachments extends ImmutablePureComponent {
}; };
render () { render () {
const { status, width, height } = this.props; const { status, width, height, visible } = this.props;
const mediaAttachments = status.get('media_attachments'); const mediaAttachments = status.get('media_attachments');
const language = status.getIn(['language', 'translation']) || status.get('language') || this.props.lang; const language = status.getIn(['language', 'translation']) || status.get('language') || this.props.lang;
@ -99,6 +100,7 @@ export default class MediaAttachments extends ImmutablePureComponent {
height={height} height={height}
inline inline
sensitive={status.get('sensitive')} sensitive={status.get('sensitive')}
visible={visible}
onOpenVideo={noop} onOpenVideo={noop}
/> />
)} )}
@ -113,6 +115,7 @@ export default class MediaAttachments extends ImmutablePureComponent {
lang={language} lang={language}
sensitive={status.get('sensitive')} sensitive={status.get('sensitive')}
defaultWidth={width} defaultWidth={width}
visible={visible}
height={height} height={height}
onOpenMedia={noop} onOpenMedia={noop}
/> />

View File

@ -47,7 +47,7 @@ class StatusCheckBox extends PureComponent {
</div> </div>
<StatusContent status={status} /> <StatusContent status={status} />
<MediaAttachments status={status} /> <MediaAttachments status={status} visible={false} />
</div> </div>
); );