From 46a9a23749d58eb3ec415fef99da065ca69ea9fc Mon Sep 17 00:00:00 2001 From: ThibG Date: Mon, 5 Mar 2018 05:09:35 +0100 Subject: [PATCH] Make more apparent that an account is blocked or muted (fixes #6544) (#6627) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add button to unblock blocked accounts from their profile * Add “Blocked” badge in place of “Follows you” when the user is blocked * Add “Muted” badge (below “follows you” badge) --- .../features/account/components/header.js | 16 ++++++++++++++++ .../account_timeline/components/header.js | 1 + app/javascript/styles/mastodon/components.scss | 16 ++++++++++++++++ 3 files changed, 33 insertions(+) diff --git a/app/javascript/mastodon/features/account/components/header.js b/app/javascript/mastodon/features/account/components/header.js index b8605d11f..075bad3f7 100644 --- a/app/javascript/mastodon/features/account/components/header.js +++ b/app/javascript/mastodon/features/account/components/header.js @@ -13,6 +13,7 @@ const messages = defineMessages({ unfollow: { id: 'account.unfollow', defaultMessage: 'Unfollow' }, follow: { id: 'account.follow', defaultMessage: 'Follow' }, requested: { id: 'account.requested', defaultMessage: 'Awaiting approval. Click to cancel follow request' }, + unblock: { id: 'account.unblock', defaultMessage: 'Unblock @{name}' }, }); class Avatar extends ImmutablePureComponent { @@ -69,6 +70,7 @@ export default class Header extends ImmutablePureComponent { static propTypes = { account: ImmutablePropTypes.map, onFollow: PropTypes.func.isRequired, + onBlock: PropTypes.func.isRequired, intl: PropTypes.object.isRequired, }; @@ -80,11 +82,18 @@ export default class Header extends ImmutablePureComponent { } let info = ''; + let mutingInfo = ''; let actionBtn = ''; let lockedIcon = ''; if (me !== account.get('id') && account.getIn(['relationship', 'followed_by'])) { info = ; + } else if (me !== account.get('id') && account.getIn(['relationship', 'blocking'])) { + info = ; + } + + if (me !== account.get('id') && account.getIn(['relationship', 'muting'])) { + mutingInfo = ; } if (me !== account.get('id')) { @@ -100,6 +109,12 @@ export default class Header extends ImmutablePureComponent { ); + } else if (account.getIn(['relationship', 'blocking'])) { + actionBtn = ( +
+ +
+ ); } } @@ -124,6 +139,7 @@ export default class Header extends ImmutablePureComponent {
{info} + {mutingInfo} {actionBtn}
diff --git a/app/javascript/mastodon/features/account_timeline/components/header.js b/app/javascript/mastodon/features/account_timeline/components/header.js index b143e1d36..9d594fb0c 100644 --- a/app/javascript/mastodon/features/account_timeline/components/header.js +++ b/app/javascript/mastodon/features/account_timeline/components/header.js @@ -82,6 +82,7 @@ export default class Header extends ImmutablePureComponent {