[Glitch] Hide bio & familiar followers from Followers/Following lists

Port 4e60a6f163e60d669ec417e290b88e9ec4a4b087 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
diondiondion 2026-04-09 11:00:09 +02:00 committed by Claire
parent 338884e37e
commit ef1a207558
3 changed files with 14 additions and 7 deletions

View File

@ -11,7 +11,6 @@ import { useRelationship } from 'flavours/glitch/hooks/useRelationship';
import type { Relationship } from 'flavours/glitch/models/relationship';
import { EmojiHTML } from '../emoji/html';
import { FamiliarFollowers } from '../familiar_followers';
import { FollowButton } from '../follow_button';
import { FormattedDateWrapper } from '../formatted_date';
import { NumberFields, NumberFieldsItem } from '../number_fields';
@ -31,10 +30,11 @@ interface Props {
accountId: string | undefined;
stats?: Stat[];
renderButton?: (options: RenderButtonOptions) => React.ReactNode;
withBio?: boolean;
withBorder?: boolean;
}
const DEFAULT_STATS: Stat[] = ['followers', 'following', 'joined'];
const DEFAULT_STATS: Stat[] = ['followers', 'posts', 'last-active'];
/**
* Extended account list item with bio, verified link badge,
@ -46,6 +46,7 @@ const DEFAULT_STATS: Stat[] = ['followers', 'following', 'joined'];
export const AccountListItem: React.FC<Props> = ({
accountId,
stats = DEFAULT_STATS,
withBio = true,
withBorder = true,
renderButton = defaultRenderButton,
}) => {
@ -161,8 +162,7 @@ export const AccountListItem: React.FC<Props> = ({
/>
)}
</NumberFields>
<FamiliarFollowers accountId={accountId} />
{account.note.length > 0 && (
{withBio && account.note.length > 0 && (
<EmojiHTML
className={classNames(classes.bio, 'translate')}
htmlString={account.note_emojified}

View File

@ -146,7 +146,6 @@ export const CollectionAccountsList: React.FC<{
<AccountListItem
accountId={account_id}
withBorder={index !== items.length - 1}
stats={['followers', 'last-active']}
renderButton={renderAccountItemButton}
/>
</Article>

View File

@ -55,12 +55,20 @@ export const AccountList: FC<AccountListProps> = ({
}
const children =
list?.items.map((followerId) => (
<AccountListItem key={followerId} accountId={followerId} />
<AccountListItem
key={followerId}
accountId={followerId}
withBio={false}
/>
)) ?? [];
if (prependAccountId) {
children.unshift(
<AccountListItem key={prependAccountId} accountId={prependAccountId} />,
<AccountListItem
key={prependAccountId}
accountId={prependAccountId}
withBio={false}
/>,
);
}
return children;