forked from treehouse/mastodon
Adds media icons to toots
parent
efacfec3ed
commit
4bc237fcfe
|
@ -175,6 +175,7 @@ class StatusUnextended extends ImmutablePureComponent {
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
let media = null;
|
let media = null;
|
||||||
|
let mediaType = null;
|
||||||
let thumb = null;
|
let thumb = null;
|
||||||
let statusAvatar;
|
let statusAvatar;
|
||||||
|
|
||||||
|
@ -222,9 +223,11 @@ class StatusUnextended extends ImmutablePureComponent {
|
||||||
|
|
||||||
} else if (status.getIn(['media_attachments', 0, 'type']) === 'video') {
|
} else if (status.getIn(['media_attachments', 0, 'type']) === 'video') {
|
||||||
media = <VideoPlayer media={status.getIn(['media_attachments', 0])} sensitive={status.get('sensitive')} onOpenVideo={this.props.onOpenVideo} />;
|
media = <VideoPlayer media={status.getIn(['media_attachments', 0])} sensitive={status.get('sensitive')} onOpenVideo={this.props.onOpenVideo} />;
|
||||||
|
mediaType = <i className='fa fa-fw fa-video-camera' aria-hidden='true' />;
|
||||||
if (!status.get('sensitive')) thumb = status.getIn(['media_attachments', 0]).get('preview_url');
|
if (!status.get('sensitive')) thumb = status.getIn(['media_attachments', 0]).get('preview_url');
|
||||||
} else {
|
} else {
|
||||||
media = <MediaGallery media={status.get('media_attachments')} sensitive={status.get('sensitive')} height={110} onOpenMedia={this.props.onOpenMedia} autoPlayGif={this.props.autoPlayGif} />;
|
media = <MediaGallery media={status.get('media_attachments')} sensitive={status.get('sensitive')} height={110} onOpenMedia={this.props.onOpenMedia} autoPlayGif={this.props.autoPlayGif} />;
|
||||||
|
mediaType = status.get('media_attachments').size > 1 ? <i className='fa fa-fw fa-th-large' aria-hidden='true' /> : <i className='fa fa-fw fa-picture-o' aria-hidden='true' />;
|
||||||
if (!status.get('sensitive')) thumb = status.getIn(['media_attachments', 0]).get('preview_url');
|
if (!status.get('sensitive')) thumb = status.getIn(['media_attachments', 0]).get('preview_url');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -239,6 +242,8 @@ class StatusUnextended extends ImmutablePureComponent {
|
||||||
<div className={`status ${this.props.muted ? 'muted' : ''} status-${status.get('visibility')} ${isCollapsed ? 'status-collapsed' : ''}`} data-id={status.get('id')} ref={this.handleRef} style={{ backgroundImage: thumb && isCollapsed ? 'url(' + thumb + ')' : 'none' }}>
|
<div className={`status ${this.props.muted ? 'muted' : ''} status-${status.get('visibility')} ${isCollapsed ? 'status-collapsed' : ''}`} data-id={status.get('id')} ref={this.handleRef} style={{ backgroundImage: thumb && isCollapsed ? 'url(' + thumb + ')' : 'none' }}>
|
||||||
<div className='status__info'>
|
<div className='status__info'>
|
||||||
|
|
||||||
|
<div className='status__info__icons'>
|
||||||
|
{mediaType}
|
||||||
<IconButton
|
<IconButton
|
||||||
className='status__collapse-button'
|
className='status__collapse-button'
|
||||||
animate flip
|
animate flip
|
||||||
|
@ -247,6 +252,7 @@ class StatusUnextended extends ImmutablePureComponent {
|
||||||
icon='angle-double-up'
|
icon='angle-double-up'
|
||||||
onClick={this.handleCollapsedClick}
|
onClick={this.handleCollapsedClick}
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
<a onClick={this.handleAccountClick} data-id={status.getIn(['account', 'id'])} href={status.getIn(['account', 'url'])} className='status__display-name'>
|
<a onClick={this.handleAccountClick} data-id={status.getIn(['account', 'id'])} href={status.getIn(['account', 'url'])} className='status__display-name'>
|
||||||
<div className='status__avatar'>
|
<div className='status__avatar'>
|
||||||
|
|
|
@ -657,9 +657,11 @@
|
||||||
line-height: 24px;
|
line-height: 24px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.status__collapse-button {
|
.status__info__icons {
|
||||||
|
display: inline-block;
|
||||||
position: relative;
|
position: relative;
|
||||||
float: right;
|
float: right;
|
||||||
|
color: $ui-highlight-color;
|
||||||
}
|
}
|
||||||
|
|
||||||
.status-check-box {
|
.status-check-box {
|
||||||
|
|
Loading…
Reference in New Issue