about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAshley <expenses@airmail.cc>2017-04-23 15:36:40 +1200
committerEugen <eugen@zeonfederated.com>2017-04-23 05:36:40 +0200
commit9cd20a7062b2dad15d5c64b93cab36c1250e6b2a (patch)
treef14777cc677a70db89f8f1912a1b8ed19ef8b2fe
parent219fb317eeee47e91066b8baebcaf02ef9e0c0bf (diff)
Tooltip for boosting depends on toot visibility (#1394) (#1754)
* Made tooltip for boosting depend on visibility

* Removed spaces that were added in merge conflict resolution

* Try again :P

* Added missing bracket

* Changed 'toot' to 'status'
-rw-r--r--app/assets/javascripts/components/components/status_action_bar.jsx4
-rw-r--r--app/assets/javascripts/components/locales/en.jsx1
2 files changed, 4 insertions, 1 deletions
diff --git a/app/assets/javascripts/components/components/status_action_bar.jsx b/app/assets/javascripts/components/components/status_action_bar.jsx
index 7b9d7a376..a84cadcfe 100644
--- a/app/assets/javascripts/components/components/status_action_bar.jsx
+++ b/app/assets/javascripts/components/components/status_action_bar.jsx
@@ -12,6 +12,7 @@ const messages = defineMessages({
   reply: { id: 'status.reply', defaultMessage: 'Reply' },
   replyAll: { id: 'status.replyAll', defaultMessage: 'Reply to thread' },
   reblog: { id: 'status.reblog', defaultMessage: 'Reblog' },
+  cannot_reblog: { id: 'status.cannot_reblog', defaultMessage: 'This post cannot be reblogged' },
   favourite: { id: 'status.favourite', defaultMessage: 'Favourite' },
   open: { id: 'status.open', defaultMessage: 'Expand this status' },
   report: { id: 'status.report', defaultMessage: 'Report @{name}' }
@@ -71,6 +72,7 @@ class StatusActionBar extends React.PureComponent {
 
   render () {
     const { status, me, intl } = this.props;
+    const reblog_disabled = status.get('visibility') === 'private' || status.get('visibility') === 'direct';
     let menu = [];
 
     menu.push({ text: intl.formatMessage(messages.open), action: this.handleOpen });
@@ -102,7 +104,7 @@ class StatusActionBar extends React.PureComponent {
     return (
       <div className='status__action-bar'>
         <div className='status__action-bar-button-wrapper'><IconButton title={reply_title} icon={reply_icon} onClick={this.handleReplyClick} /></div>
-        <div className='status__action-bar-button-wrapper'><IconButton disabled={status.get('visibility') === 'private' || status.get('visibility') === 'direct'} active={status.get('reblogged')} title={intl.formatMessage(messages.reblog)} icon={reblogIcon} onClick={this.handleReblogClick} /></div>
+        <div className='status__action-bar-button-wrapper'><IconButton disabled={reblog_disabled} active={status.get('reblogged')} title={reblog_disabled ? intl.formatMessage(messages.cannot_reblog) : intl.formatMessage(messages.reblog)} icon={reblogIcon} onClick={this.handleReblogClick} /></div>
         <div className='status__action-bar-button-wrapper'><IconButton animate={true} active={status.get('favourited')} title={intl.formatMessage(messages.favourite)} icon='star' onClick={this.handleFavouriteClick} className='star-icon' /></div>
 
         <div className='status__action-bar-dropdown'>
diff --git a/app/assets/javascripts/components/locales/en.jsx b/app/assets/javascripts/components/locales/en.jsx
index 420cfe00f..180caeaf1 100644
--- a/app/assets/javascripts/components/locales/en.jsx
+++ b/app/assets/javascripts/components/locales/en.jsx
@@ -119,6 +119,7 @@ const en = {
   "status.mention": "Mention @{name}",
   "status.open": "Expand this status",
   "status.reblog": "Boost",
+  "status.cannot_reblog": "This status cannot be boosted",
   "status.reblogged_by": "{name} boosted",
   "status.reply": "Reply",
   "status.replyAll": "Reply to thread",