feat: allow user to view follow list in "Hide following/follower count" mode (#1901)

This commit is contained in:
Kingsley Yung 2023-04-17 03:47:20 +08:00 committed by GitHub
parent 18ea4ffb6e
commit ca8d785d9e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 3 deletions

View file

@ -19,6 +19,6 @@ const relationship = $(useRelationship(account))
<div v-if="account.note" max-h-100 overflow-y-auto>
<ContentRich text-4 text-secondary :content="account.note" :emojis="account.emojis" />
</div>
<AccountPostsFollowers text-sm :account="account" />
<AccountPostsFollowers text-sm :account="account" :is-hover-card="true" />
</div>
</template>

View file

@ -3,6 +3,7 @@ import type { mastodon } from 'masto'
defineProps<{
account: mastodon.v1.Account
isHoverCard?: boolean
}>()
const userSettings = useUserSettings()
@ -26,33 +27,37 @@ const userSettings = useUserSettings()
</template>
</NuxtLink>
<NuxtLink
v-if="!getPreferences(userSettings, 'hideFollowerCount')"
v-if="!(isHoverCard && getPreferences(userSettings, 'hideFollowerCount'))"
:to="getAccountFollowingRoute(account)"
replace
text-secondary exact-active-class="text-primary"
>
<template #default="{ isExactActive }">
<CommonLocalizedNumber
v-if="!getPreferences(userSettings, 'hideFollowerCount')"
keypath="account.following_count"
:count="account.followingCount"
font-bold
:class="isExactActive ? 'text-primary' : 'text-base'"
/>
<span v-else>{{ $t('account.following') }}</span>
</template>
</NuxtLink>
<NuxtLink
v-if="!getPreferences(userSettings, 'hideFollowerCount')"
v-if="!(isHoverCard && getPreferences(userSettings, 'hideFollowerCount'))"
:to="getAccountFollowersRoute(account)"
replace text-secondary
exact-active-class="text-primary"
>
<template #default="{ isExactActive }">
<CommonLocalizedNumber
v-if="!getPreferences(userSettings, 'hideFollowerCount')"
keypath="account.followers_count"
:count="account.followersCount"
font-bold
:class="isExactActive ? 'text-primary' : 'text-base'"
/>
<span v-else>{{ $t('account.followers') }}</span>
</template>
</NuxtLink>
</div>