sforkowany z mirror/soapbox
Merge branch 'attachment-thumbs-sensitive' into 'develop'
Fix: Quote posts do not carry sensitive tag Closes #852 See merge request soapbox-pub/soapbox-fe!1079purgecss
commit
edb80c705d
|
@ -15,6 +15,7 @@ class AttachmentThumbs extends ImmutablePureComponent {
|
||||||
dispatch: PropTypes.func.isRequired,
|
dispatch: PropTypes.func.isRequired,
|
||||||
media: ImmutablePropTypes.list.isRequired,
|
media: ImmutablePropTypes.list.isRequired,
|
||||||
onClick: PropTypes.func,
|
onClick: PropTypes.func,
|
||||||
|
sensitive: PropTypes.bool,
|
||||||
};
|
};
|
||||||
|
|
||||||
renderLoading() {
|
renderLoading() {
|
||||||
|
@ -26,7 +27,7 @@ class AttachmentThumbs extends ImmutablePureComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { media, onClick } = this.props;
|
const { media, onClick, sensitive } = this.props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='attachment-thumbs'>
|
<div className='attachment-thumbs'>
|
||||||
|
@ -37,6 +38,7 @@ class AttachmentThumbs extends ImmutablePureComponent {
|
||||||
onOpenMedia={this.onOpenMedia}
|
onOpenMedia={this.onOpenMedia}
|
||||||
height={50}
|
height={50}
|
||||||
compact
|
compact
|
||||||
|
sensitive={sensitive}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</Bundle>
|
</Bundle>
|
||||||
|
|
|
@ -590,10 +590,15 @@ class MediaGallery extends React.PureComponent {
|
||||||
|
|
||||||
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 className={classNames('spoiler-button', { 'spoiler-button--minified': visible })}>
|
<div className={classNames('spoiler-button', { 'spoiler-button--minified': visible || compact })}>
|
||||||
{sensitive && (
|
{sensitive && (
|
||||||
visible ? (
|
(visible || compact) ? (
|
||||||
<IconButton title={intl.formatMessage(messages.toggle_visible)} src={require('@tabler/icons/icons/eye-off.svg')} overlay onClick={this.handleOpen} />
|
<IconButton
|
||||||
|
title={intl.formatMessage(messages.toggle_visible)}
|
||||||
|
src={visible ? require('@tabler/icons/icons/eye-off.svg') : require('@tabler/icons/icons/eye.svg')}
|
||||||
|
overlay
|
||||||
|
onClick={this.handleOpen}
|
||||||
|
/>
|
||||||
) : (
|
) : (
|
||||||
<button type='button' onClick={this.handleOpen} className='spoiler-button__overlay'>
|
<button type='button' onClick={this.handleOpen} className='spoiler-button__overlay'>
|
||||||
<span className='spoiler-button__overlay__label'>
|
<span className='spoiler-button__overlay__label'>
|
||||||
|
|
|
@ -393,7 +393,11 @@ class Status extends ImmutablePureComponent {
|
||||||
if (size > 0) {
|
if (size > 0) {
|
||||||
if (this.props.muted) {
|
if (this.props.muted) {
|
||||||
media = (
|
media = (
|
||||||
<AttachmentThumbs media={status.get('media_attachments')} onClick={this.handleClick} />
|
<AttachmentThumbs
|
||||||
|
media={status.get('media_attachments')}
|
||||||
|
onClick={this.handleClick}
|
||||||
|
sensitive={status.get('sensitive')}
|
||||||
|
/>
|
||||||
);
|
);
|
||||||
} else if (size === 1 && status.getIn(['media_attachments', 0, 'type']) === 'video') {
|
} else if (size === 1 && status.getIn(['media_attachments', 0, 'type']) === 'video') {
|
||||||
const video = status.getIn(['media_attachments', 0]);
|
const video = status.getIn(['media_attachments', 0]);
|
||||||
|
|
|
@ -64,6 +64,7 @@ class ReplyIndicator extends ImmutablePureComponent {
|
||||||
<AttachmentThumbs
|
<AttachmentThumbs
|
||||||
compact
|
compact
|
||||||
media={status.get('media_attachments')}
|
media={status.get('media_attachments')}
|
||||||
|
sensitive={status.get('sensitive')}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -76,6 +76,7 @@ class ScheduledStatus extends ImmutablePureComponent {
|
||||||
<AttachmentThumbs
|
<AttachmentThumbs
|
||||||
compact
|
compact
|
||||||
media={status.get('media_attachments')}
|
media={status.get('media_attachments')}
|
||||||
|
sensitive={status.get('sensitive')}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|
|
@ -145,6 +145,7 @@ class QuotedStatus extends ImmutablePureComponent {
|
||||||
<AttachmentThumbs
|
<AttachmentThumbs
|
||||||
compact
|
compact
|
||||||
media={status.get('media_attachments')}
|
media={status.get('media_attachments')}
|
||||||
|
sensitive={status.get('sensitive')}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -93,6 +93,7 @@ class BoostModal extends ImmutablePureComponent {
|
||||||
<AttachmentThumbs
|
<AttachmentThumbs
|
||||||
compact
|
compact
|
||||||
media={status.get('media_attachments')}
|
media={status.get('media_attachments')}
|
||||||
|
sensitive={status.get('sensitive')}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -199,8 +199,9 @@ $media-compact-size: 50px;
|
||||||
height: $media-compact-size !important;
|
height: $media-compact-size !important;
|
||||||
background: transparent;
|
background: transparent;
|
||||||
|
|
||||||
.spoiler-button {
|
.spoiler-button .svg-icon {
|
||||||
display: none;
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.media-gallery__item {
|
.media-gallery__item {
|
||||||
|
|
Ładowanie…
Reference in New Issue