Let users browse followers and following lists
Following lists are public; followers are visible to the user and to mutual followers.
Adds GET /users/{id}/followers and /following, exposes isFollowing and canViewFollowers
on the profile, and returns isFollowedByViewer from user search so the web player no
longer calls /is-following per user.
This commit is contained in:
@@ -22,18 +22,27 @@
|
||||
</svelte:head>
|
||||
|
||||
{#snippet followAction()}
|
||||
<FollowButton following={data.isFollowing} invalidateAll />
|
||||
<FollowButton following={profile.isFollowing} invalidateAll />
|
||||
{/snippet}
|
||||
|
||||
{#snippet followStats()}
|
||||
{@const followers = plural(Number(profile.followersCount), 'seguidor', 'seguidores')}
|
||||
{#if data.isOwnProfile || profile.canViewFollowers}
|
||||
<a href="/user/{profile.id}/followers" class="transition-colors hover:text-fg">{followers}</a>
|
||||
{:else}
|
||||
<span>{followers}</span>
|
||||
{/if}
|
||||
·
|
||||
<a href="/user/{profile.id}/following" class="transition-colors hover:text-fg">
|
||||
{profile.followingCount} siguiendo
|
||||
</a>
|
||||
{/snippet}
|
||||
|
||||
<Page>
|
||||
<PageHeader
|
||||
eyebrow="Perfil"
|
||||
title={profile.name}
|
||||
meta="{plural(
|
||||
Number(profile.followersCount),
|
||||
'seguidor',
|
||||
'seguidores'
|
||||
)} · {profile.followingCount} siguiendo"
|
||||
meta={followStats}
|
||||
align="center"
|
||||
actions={canFollow ? followAction : undefined}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user