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:
@@ -0,0 +1,28 @@
|
||||
<script lang="ts">
|
||||
import ListRow from './ListRow.svelte';
|
||||
import Avatar from './Avatar.svelte';
|
||||
import FollowButton from './FollowButton.svelte';
|
||||
|
||||
interface Props {
|
||||
user: {
|
||||
id: string;
|
||||
name: string;
|
||||
profilePictureUrl: string | null;
|
||||
isFollowedByViewer: boolean;
|
||||
};
|
||||
canFollow?: boolean;
|
||||
}
|
||||
|
||||
let { user, canFollow = false }: Props = $props();
|
||||
</script>
|
||||
|
||||
<div class="flex items-center gap-3">
|
||||
<ListRow title={user.name} href="/user/{user.id}" size="lg" class="min-w-0 flex-1">
|
||||
{#snippet art()}
|
||||
<Avatar name={user.name} src={user.profilePictureUrl} size="md" />
|
||||
{/snippet}
|
||||
</ListRow>
|
||||
{#if canFollow}
|
||||
<FollowButton following={user.isFollowedByViewer} userId={user.id} class="shrink-0" />
|
||||
{/if}
|
||||
</div>
|
||||
Reference in New Issue
Block a user