]>
cat aescling's git repositories - mastodon.git/blob - app/javascript/mastodon/components/attachment_list.js
1 import React
from 'react';
2 import ImmutablePropTypes
from 'react-immutable-proptypes';
4 const filename
= url
=> url
.split('/').pop().split('#')[0].split('?')[0];
6 class AttachmentList
extends React
.PureComponent
{
9 media: ImmutablePropTypes
.list
.isRequired
,
13 const { media
} = this.props
;
16 <div className
='attachment-list'>
17 <div className
='attachment-list__icon'>
18 <i className
='fa fa-link' />
21 <ul className
='attachment-list__list'>
22 {media
.map(attachment
=>
23 <li key
={attachment
.get('id')}>
24 <a href
={attachment
.get('remote_url')} target
='_blank' rel
='noopener'>{filename(attachment
.get('remote_url'))}</a
>
34 export default AttachmentList
;
This page took 0.100966 seconds and 4 git commands to generate.