Display AttachmentList in notifications (#6693)
This commit is contained in:
parent
510c9049c7
commit
77406d3a09
@ -19,11 +19,15 @@ export default class AttachmentList extends ImmutablePureComponent {
|
|||||||
return (
|
return (
|
||||||
<div className='attachment-list compact'>
|
<div className='attachment-list compact'>
|
||||||
<ul className='attachment-list__list'>
|
<ul className='attachment-list__list'>
|
||||||
{media.map(attachment => (
|
{media.map(attachment => {
|
||||||
|
const displayUrl = attachment.get('remote_url') || attachment.get('url');
|
||||||
|
|
||||||
|
return (
|
||||||
<li key={attachment.get('id')}>
|
<li key={attachment.get('id')}>
|
||||||
<a href={attachment.get('remote_url')} target='_blank' rel='noopener'><i className='fa fa-link' /> {filename(attachment.get('remote_url'))}</a>
|
<a href={displayUrl} target='_blank' rel='noopener'><i className='fa fa-link' /> {filename(displayUrl)}</a>
|
||||||
</li>
|
</li>
|
||||||
))}
|
);
|
||||||
|
})}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
@ -36,11 +40,15 @@ export default class AttachmentList extends ImmutablePureComponent {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ul className='attachment-list__list'>
|
<ul className='attachment-list__list'>
|
||||||
{media.map(attachment => (
|
{media.map(attachment => {
|
||||||
|
const displayUrl = attachment.get('remote_url') || attachment.get('url');
|
||||||
|
|
||||||
|
return (
|
||||||
<li key={attachment.get('id')}>
|
<li key={attachment.get('id')}>
|
||||||
<a href={attachment.get('remote_url')} target='_blank' rel='noopener'>{filename(attachment.get('remote_url'))}</a>
|
<a href={displayUrl} target='_blank' rel='noopener'>{filename(displayUrl)}</a>
|
||||||
</li>
|
</li>
|
||||||
))}
|
);
|
||||||
|
})}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
@ -178,8 +178,8 @@ export default class Status extends ImmutablePureComponent {
|
|||||||
status = status.get('reblog');
|
status = status.get('reblog');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (status.get('media_attachments').size > 0 && !this.props.muted) {
|
if (status.get('media_attachments').size > 0) {
|
||||||
if (status.get('media_attachments').some(item => item.get('type') === 'unknown')) {
|
if (this.props.muted || status.get('media_attachments').some(item => item.get('type') === 'unknown')) {
|
||||||
media = (
|
media = (
|
||||||
<AttachmentList
|
<AttachmentList
|
||||||
compact
|
compact
|
||||||
|
Loading…
Reference in New Issue
Block a user