|
|
@ -237,9 +237,6 @@ class StatusActionBar extends ImmutablePureComponent { |
|
|
|
const account = status.get('account'); |
|
|
|
|
|
|
|
let menu = []; |
|
|
|
let reblogIcon = 'retweet'; |
|
|
|
let replyIcon; |
|
|
|
let replyTitle; |
|
|
|
|
|
|
|
menu.push({ text: intl.formatMessage(messages.open), action: this.handleOpen }); |
|
|
|
|
|
|
@ -259,10 +256,6 @@ class StatusActionBar extends ImmutablePureComponent { |
|
|
|
if (status.getIn(['account', 'id']) === me) { |
|
|
|
if (publicStatus) { |
|
|
|
menu.push({ text: intl.formatMessage(status.get('pinned') ? messages.unpin : messages.pin), action: this.handlePinClick }); |
|
|
|
} else { |
|
|
|
if (status.get('visibility') === 'private') { |
|
|
|
menu.push({ text: intl.formatMessage(status.get('reblogged') ? messages.cancel_reblog_private : messages.reblog_private), action: this.handleReblogClick }); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
menu.push({ text: intl.formatMessage(messages.delete), action: this.handleDeleteClick }); |
|
|
@ -305,12 +298,8 @@ class StatusActionBar extends ImmutablePureComponent { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (status.get('visibility') === 'direct') { |
|
|
|
reblogIcon = 'envelope'; |
|
|
|
} else if (status.get('visibility') === 'private') { |
|
|
|
reblogIcon = 'lock'; |
|
|
|
} |
|
|
|
|
|
|
|
let replyIcon; |
|
|
|
let replyTitle; |
|
|
|
if (status.get('in_reply_to_id', null) === null) { |
|
|
|
replyIcon = 'reply'; |
|
|
|
replyTitle = intl.formatMessage(messages.reply); |
|
|
@ -319,6 +308,19 @@ class StatusActionBar extends ImmutablePureComponent { |
|
|
|
replyTitle = intl.formatMessage(messages.replyAll); |
|
|
|
} |
|
|
|
|
|
|
|
const reblogPrivate = status.getIn(['account', 'id']) === me && status.get('visibility') === 'private'; |
|
|
|
|
|
|
|
let reblogTitle = ''; |
|
|
|
if (status.get('reblogged')) { |
|
|
|
reblogTitle = intl.formatMessage(messages.cancel_reblog_private); |
|
|
|
} else if (publicStatus) { |
|
|
|
reblogTitle = intl.formatMessage(messages.reblog); |
|
|
|
} else if (reblogPrivate) { |
|
|
|
reblogTitle = intl.formatMessage(messages.reblog_private); |
|
|
|
} else { |
|
|
|
reblogTitle = intl.formatMessage(messages.cannot_reblog); |
|
|
|
} |
|
|
|
|
|
|
|
const shareButton = ('share' in navigator) && publicStatus && ( |
|
|
|
<IconButton className='status__action-bar-button' title={intl.formatMessage(messages.share)} icon='share-alt' onClick={this.handleShareClick} /> |
|
|
|
); |
|
|
@ -326,7 +328,7 @@ class StatusActionBar extends ImmutablePureComponent { |
|
|
|
return ( |
|
|
|
<div className='status__action-bar'> |
|
|
|
<div className='status__action-bar__counter'><IconButton className='status__action-bar-button' title={replyTitle} icon={status.get('in_reply_to_account_id') === status.getIn(['account', 'id']) ? 'reply' : replyIcon} onClick={this.handleReplyClick} /><span className='status__action-bar__counter__label' >{obfuscatedCount(status.get('replies_count'))}</span></div> |
|
|
|
<IconButton className='status__action-bar-button' disabled={!publicStatus} active={status.get('reblogged')} pressed={status.get('reblogged')} title={!publicStatus ? intl.formatMessage(messages.cannot_reblog) : intl.formatMessage(messages.reblog)} icon={reblogIcon} onClick={this.handleReblogClick} /> |
|
|
|
<IconButton className='status__action-bar-button' disabled={!publicStatus && !reblogPrivate} active={status.get('reblogged')} pressed={status.get('reblogged')} title={reblogTitle} icon='retweet' onClick={this.handleReblogClick} /> |
|
|
|
<IconButton className='status__action-bar-button star-icon' animate active={status.get('favourited')} pressed={status.get('favourited')} title={intl.formatMessage(messages.favourite)} icon='star' onClick={this.handleFavouriteClick} /> |
|
|
|
{shareButton} |
|
|
|
|
|
|
|