From f92ff6d699ddb468a373158eb0a2aa1b440b3192 Mon Sep 17 00:00:00 2001 From: diondiondion Date: Thu, 12 Jun 2025 18:13:17 +0200 Subject: [PATCH] fix: Hide limited user info in hover card (#35024) --- .../components/hover_card_account.tsx | 148 +++++++++++------- .../styles/mastodon/components.scss | 5 + 2 files changed, 95 insertions(+), 58 deletions(-) diff --git a/app/javascript/mastodon/components/hover_card_account.tsx b/app/javascript/mastodon/components/hover_card_account.tsx index afe82a601..a6bdda216 100644 --- a/app/javascript/mastodon/components/hover_card_account.tsx +++ b/app/javascript/mastodon/components/hover_card_account.tsx @@ -20,6 +20,7 @@ import { LoadingIndicator } from 'mastodon/components/loading_indicator'; import { ShortNumber } from 'mastodon/components/short_number'; import { useFetchFamiliarFollowers } from 'mastodon/features/account_timeline/hooks/familiar_followers'; import { domain } from 'mastodon/initial_state'; +import { getAccountHidden } from 'mastodon/selectors/accounts'; import { useAppSelector, useAppDispatch } from 'mastodon/store'; export const HoverCardAccount = forwardRef< @@ -31,6 +32,11 @@ export const HoverCardAccount = forwardRef< const account = useAppSelector((state) => accountId ? state.accounts.get(accountId) : undefined, ); + const suspended = account?.suspended; + const hidden = useAppSelector((state) => + accountId ? getAccountHidden(state, accountId) : undefined, + ); + const isSuspendedOrHidden = Boolean(suspended || hidden); const note = useAppSelector( (state) => @@ -70,69 +76,95 @@ export const HoverCardAccount = forwardRef< {account ? ( <> - + -
- - - {note && note.length > 0 && ( -
-
- -
-
{note}
-
- )} -
- -
- - {shouldDisplayFamiliarFollowers && ( - <> - · -
- - - {familiarFollowers.slice(0, 3).map((account) => ( - - ))} - -
- - )} - {(isMutual || isFollower) && ( - <> - · - {isMutual ? ( - - ) : ( - + {isSuspendedOrHidden ? ( +
+ {suspended ? ( + + ) : ( + + )} +
+ ) : ( + <> +
+ + + {note && note.length > 0 && ( +
+
+ +
+
{note}
+
)} - - )} -
+
- +
+ + {shouldDisplayFamiliarFollowers && ( + <> + · +
+ + + {familiarFollowers.slice(0, 3).map((account) => ( + + ))} + +
+ + )} + {(isMutual || isFollower) && ( + <> + · + {isMutual ? ( + + ) : ( + + )} + + )} +
+ + + + )} ) : ( diff --git a/app/javascript/styles/mastodon/components.scss b/app/javascript/styles/mastodon/components.scss index 6dca91a19..6cfe3bd6b 100644 --- a/app/javascript/styles/mastodon/components.scss +++ b/app/javascript/styles/mastodon/components.scss @@ -10899,6 +10899,11 @@ noscript { } } + &__limited-account-note { + text-align: center; + font-weight: 500; + } + .display-name { font-size: 15px; line-height: 22px;