about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/components/account.js
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2022-05-11 12:14:29 +0200
committerGitHub <noreply@github.com>2022-05-11 12:14:29 +0200
commit32762f2fa864d8f56dfba59e8b5ff6ccf03aecb6 (patch)
treed7143f63d6fc7d0d6d817d61f2fcc335fe4aba7a /app/javascript/flavours/glitch/components/account.js
parente8b8ac8908c6623f0fd7ffccc7de3882a773b72f (diff)
parent6fb837aa1d34fbafda1fe561d1a3789ac281d27c (diff)
Merge pull request #1767 from ClearlyClaire/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/javascript/flavours/glitch/components/account.js')
-rw-r--r--app/javascript/flavours/glitch/components/account.js12
1 files changed, 10 insertions, 2 deletions
diff --git a/app/javascript/flavours/glitch/components/account.js b/app/javascript/flavours/glitch/components/account.js
index 396a36ea0..489f60736 100644
--- a/app/javascript/flavours/glitch/components/account.js
+++ b/app/javascript/flavours/glitch/components/account.js
@@ -16,8 +16,10 @@ const messages = defineMessages({
   requested: { id: 'account.requested', defaultMessage: 'Awaiting approval' },
   unblock: { id: 'account.unblock', defaultMessage: 'Unblock @{name}' },
   unmute: { id: 'account.unmute', defaultMessage: 'Unmute @{name}' },
-  mute_notifications: { id: 'account.mute_notifications', defaultMessage: 'You are not currently muting notifications from @{name}. Click to mute notifications' },
-  unmute_notifications: { id: 'account.unmute_notifications', defaultMessage: 'You are currently muting notifications from @{name}. Click to unmute notifications' },
+  mute_notifications: { id: 'account.mute_notifications', defaultMessage: 'Mute notifications from @{name}' },
+  unmute_notifications: { id: 'account.unmute_notifications', defaultMessage: 'Unmute notifications from @{name}' },
+  mute: { id: 'account.mute', defaultMessage: 'Mute @{name}' },
+  block: { id: 'account.block', defaultMessage: 'Block @{name}' },
 });
 
 export default @injectIntl
@@ -34,6 +36,7 @@ class Account extends ImmutablePureComponent {
     small: PropTypes.bool,
     actionIcon: PropTypes.string,
     actionTitle: PropTypes.string,
+    defaultAction: PropTypes.string,
     onActionClick: PropTypes.func,
   };
 
@@ -70,6 +73,7 @@ class Account extends ImmutablePureComponent {
       onActionClick,
       actionIcon,
       actionTitle,
+      defaultAction,
     } = this.props;
 
     if (!account) {
@@ -114,6 +118,10 @@ class Account extends ImmutablePureComponent {
             {hidingNotificationsButton}
           </Fragment>
         );
+      } else if (defaultAction === 'mute') {
+        buttons = <IconButton icon='volume-off' title={intl.formatMessage(messages.mute, { name: account.get('username') })} onClick={this.handleMute} />;
+      } else if (defaultAction === 'block') {
+        buttons = <IconButton icon='lock' title={intl.formatMessage(messages.block, { name: account.get('username') })} onClick={this.handleBlock} />;
       } else if (!account.get('moved') || following) {
         buttons = <IconButton icon={following ? 'user-times' : 'user-plus'} title={intl.formatMessage(following ? messages.unfollow : messages.follow)} onClick={this.handleFollow} active={following} />;
       }