1
0
Fork 1
mirror of https://github.com/elk-zone/elk.git synced 2024-11-07 09:29:59 +00:00

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> <div v-if="account.note" max-h-100 overflow-y-auto>
<ContentRich text-4 text-secondary :content="account.note" :emojis="account.emojis" /> <ContentRich text-4 text-secondary :content="account.note" :emojis="account.emojis" />
</div> </div>
<AccountPostsFollowers text-sm :account="account" /> <AccountPostsFollowers text-sm :account="account" :is-hover-card="true" />
</div> </div>
</template> </template>

View file

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