From 6775de3fc98c46e26a07ed69f6f2459e6b1fce70 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Thu, 10 Sep 2020 00:07:19 +0200 Subject: [Glitch] Change web UI to show empty profile for suspended accounts Port fcb9350ff8cdc83388f75de6b031410df8aa8a56 to glitch-soc Signed-off-by: Thibaut Girka --- .../glitch/features/account/components/header.js | 76 ++++++++++++---------- 1 file changed, 42 insertions(+), 34 deletions(-) (limited to 'app/javascript/flavours/glitch/features/account') diff --git a/app/javascript/flavours/glitch/features/account/components/header.js b/app/javascript/flavours/glitch/features/account/components/header.js index 0af0935e6..88c578b59 100644 --- a/app/javascript/flavours/glitch/features/account/components/header.js +++ b/app/javascript/flavours/glitch/features/account/components/header.js @@ -134,6 +134,8 @@ class Header extends ImmutablePureComponent { const accountNote = account.getIn(['relationship', 'note']); + const suspended = account.get('suspended'); + let info = []; let actionBtn = ''; let lockedIcon = ''; @@ -170,17 +172,21 @@ class Header extends ImmutablePureComponent { actionBtn = ''; } + if (suspended && !account.getIn(['relationship', 'following'])) { + actionBtn = ''; + } + if (account.get('locked')) { lockedIcon = ; } - if (account.get('id') !== me) { + if (account.get('id') !== me && !suspended) { menu.push({ text: intl.formatMessage(messages.mention, { name: account.get('username') }), action: this.props.onMention }); menu.push({ text: intl.formatMessage(messages.direct, { name: account.get('username') }), action: this.props.onDirect }); menu.push(null); } - if ('share' in navigator) { + if ('share' in navigator && !suspended) { menu.push({ text: intl.formatMessage(messages.share, { name: account.get('username') }), action: this.handleShare }); menu.push(null); } @@ -297,39 +303,41 @@ class Header extends ImmutablePureComponent { -
-
- { (fields.size > 0 || identity_proofs.size > 0) && ( -
- {identity_proofs.map((proof, i) => ( -
-
- -
- - - - -
-
- ))} - {fields.map((pair, i) => ( -
-
- -
- {pair.get('verified_at') && } -
-
- ))} -
- )} - - {account.get('note').length > 0 && account.get('note') !== '

' &&
} + {!suspended && ( +
+
+ { (fields.size > 0 || identity_proofs.size > 0) && ( +
+ {identity_proofs.map((proof, i) => ( +
+
+ +
+ + + + +
+
+ ))} + {fields.map((pair, i) => ( +
+
+ +
+ {pair.get('verified_at') && } +
+
+ ))} +
+ )} + + {account.get('note').length > 0 && account.get('note') !== '

' &&
} +
-
-
-
+ )} +
+ ); } -- cgit