From 9b85b4ad7f0b5b75f960aa505503dee5f1a691fd Mon Sep 17 00:00:00 2001 From: Mary Kate Date: Wed, 12 Aug 2020 13:02:20 -0500 Subject: [PATCH] remove info from deactivated account pages --- .../features/account/components/header.js | 78 ++++++++++--------- .../ui/components/profile_info_panel.js | 45 +++++++---- app/styles/components/account-header.scss | 4 + app/styles/components/columns.scss | 1 + app/styles/components/profile-info-panel.scss | 18 +++++ 5 files changed, 92 insertions(+), 54 deletions(-) diff --git a/app/soapbox/features/account/components/header.js b/app/soapbox/features/account/components/header.js index a26ff710f..3ec8919a3 100644 --- a/app/soapbox/features/account/components/header.js +++ b/app/soapbox/features/account/components/header.js @@ -221,12 +221,12 @@ class Header extends ImmutablePureComponent { const menu = this.makeMenu(); const headerMissing = (account.get('header').indexOf('/headers/original/missing.png') > -1); - const avatarSize = isSmallScreen ? 90 : 200; + const deactivated = account.getIn(['pleroma', 'deactivated'], false); return (
-
+
{info}
@@ -238,56 +238,58 @@ class Header extends ImmutablePureComponent {
- + { !deactivated && }
-
+ { !deactivated && +
- - {shortNumberFormat(account.get('statuses_count'))} - - + + {shortNumberFormat(account.get('statuses_count'))} + + - - {shortNumberFormat(account.get('following_count'))} - - + + {shortNumberFormat(account.get('following_count'))} + + - - {shortNumberFormat(account.get('followers_count'))} - - + + {shortNumberFormat(account.get('followers_count'))} + + - { - account.get('id') === me && -
- - { /* : TODO : shortNumberFormat(account.get('favourite_count')) */ } - - - - - { /* : TODO : shortNumberFormat(account.get('pinned_count')) */ } - - - -
- } -
+ { + account.get('id') === me && +
+ + { /* : TODO : shortNumberFormat(account.get('favourite_count')) */ } + + + + + { /* : TODO : shortNumberFormat(account.get('pinned_count')) */ } + + + +
+ } +
+ } { isSmallScreen && -
+
} { - me && + me && !deactivated &&
{account.get('id') !== me && diff --git a/app/soapbox/features/ui/components/profile_info_panel.js b/app/soapbox/features/ui/components/profile_info_panel.js index 592d60ee0..0412beab9 100644 --- a/app/soapbox/features/ui/components/profile_info_panel.js +++ b/app/soapbox/features/ui/components/profile_info_panel.js @@ -11,10 +11,12 @@ import VerificationBadge from 'soapbox/components/verification_badge'; import Badge from 'soapbox/components/badge'; import { List as ImmutableList } from 'immutable'; import { acctFull, isAdmin, isModerator } from 'soapbox/utils/accounts'; +import classNames from 'classnames'; const messages = defineMessages({ linkVerifiedOn: { id: 'account.link_verified_on', defaultMessage: 'Ownership of this link was checked on {date}' }, account_locked: { id: 'account.locked_info', defaultMessage: 'This account privacy status is set to locked. The owner manually reviews who can follow them.' }, + deactivated: { id: 'account.deactivated', defaultMessage: 'Deactivated' }, }); const dateFormatOptions = { @@ -57,36 +59,47 @@ class ProfileInfoPanel extends ImmutablePureComponent { const badge = account.get('bot') ? (
) : null; const content = { __html: account.get('note_emojified') }; const fields = account.get('fields'); - const displayNameHtml = { __html: account.get('display_name_html') }; + const deactivated = account.getIn(['pleroma', 'deactivated'], false); + const displayNameHtml = deactivated ? { __html: intl.formatMessage(messages.deactivated) } : { __html: account.get('display_name_html') }; const memberSinceDate = intl.formatDate(account.get('created_at'), { month: 'long', year: 'numeric' }); - const verified = account.get('pleroma').get('tags').includes('verified'); + const verified = account.getIn(['pleroma', 'tags'], ImmutableList()).includes('verified'); return ( -
+

- + {verified && } {badge} - @{acctFull(account)} {lockedIcon} + { !deactivated && @{acctFull(account)} {lockedIcon} }

-
- {isAdmin(account) && } - {isModerator(account) && } - {account.getIn(['patron', 'is_patron']) && } - {account.get('acct').includes('@') ||
- + { !deactivated && +
+ {isAdmin(account) && } + {isModerator(account) && } + {account.getIn(['patron', 'is_patron']) && } + {account.get('acct').includes('@') ||
+ + +
} +
+ } + + { deactivated && +
-
} -
+
+ } { (account.get('note').length > 0 && account.get('note') !== '

') && diff --git a/app/styles/components/account-header.scss b/app/styles/components/account-header.scss index 0a112f469..02bb9ccbf 100644 --- a/app/styles/components/account-header.scss +++ b/app/styles/components/account-header.scss @@ -207,6 +207,10 @@ padding: 10px 10px 0; &--nonuser {padding: 10px 10px 15px;} } + + .account-mobile-container.deactivated { + margin-top: 50px; + } } } // end .account__header diff --git a/app/styles/components/columns.scss b/app/styles/components/columns.scss index d8034e497..2151b168b 100644 --- a/app/styles/components/columns.scss +++ b/app/styles/components/columns.scss @@ -678,6 +678,7 @@ align-items: center; justify-content: center; min-height: 160px; + border-radius: 0 0 10px 10px; @supports(display: grid) { // hack to fix Chrome <57 contain: strict; diff --git a/app/styles/components/profile-info-panel.scss b/app/styles/components/profile-info-panel.scss index 7474d0f06..04c54f722 100644 --- a/app/styles/components/profile-info-panel.scss +++ b/app/styles/components/profile-info-panel.scss @@ -128,3 +128,21 @@ } } } + +.profile-info-panel.deactivated { + .profile-info-panel__name-content { + text-transform: uppercase; + } + + .profile-info-panel__name-content::before { + content: '['; + } + + .profile-info-panel__name-content::after { + content: ']'; + } + + .profile-info-panel-content__deactivated { + color: var(--primary-text-color--faint); + } +}