Hide bio & familiar followers from Followers/Following lists (#38622)
This commit is contained in:
parent
b6f09b9a2b
commit
4e60a6f163
@ -11,7 +11,6 @@ import { useRelationship } from 'mastodon/hooks/useRelationship';
|
||||
import type { Relationship } from 'mastodon/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}
|
||||
|
||||
@ -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>
|
||||
|
||||
@ -53,12 +53,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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user