2020-01-29 21:37:25 +02:00
|
|
|
<template>
|
2020-11-25 14:31:34 +02:00
|
|
|
<div>
|
2022-01-09 20:30:35 +02:00
|
|
|
<MkPagination v-slot="{items}" ref="list" :pagination="type === 'following' ? followingPagination : followersPagination" class="mk-following-or-followers">
|
2021-04-10 12:17:42 +03:00
|
|
|
<div class="users _isolated">
|
2021-11-19 12:36:12 +02:00
|
|
|
<MkUserInfo v-for="user in items.map(x => type === 'following' ? x.followee : x.follower)" :key="user.id" class="user" :user="user"/>
|
2020-01-29 21:37:25 +02:00
|
|
|
</div>
|
2020-10-17 14:12:00 +03:00
|
|
|
</MkPagination>
|
|
|
|
</div>
|
2020-01-29 21:37:25 +02:00
|
|
|
</template>
|
|
|
|
|
2022-01-12 19:46:14 +02:00
|
|
|
<script lang="ts" setup>
|
|
|
|
import { computed } from 'vue';
|
|
|
|
import * as misskey from 'misskey-js';
|
2021-11-11 19:02:25 +02:00
|
|
|
import MkUserInfo from '@/components/user-info.vue';
|
|
|
|
import MkPagination from '@/components/ui/pagination.vue';
|
2020-01-29 21:37:25 +02:00
|
|
|
|
2022-01-12 19:46:14 +02:00
|
|
|
const props = defineProps<{
|
|
|
|
user: misskey.entities.User;
|
|
|
|
type: 'following' | 'followers';
|
|
|
|
}>();
|
2020-01-29 21:37:25 +02:00
|
|
|
|
2022-01-12 19:46:14 +02:00
|
|
|
const followingPagination = {
|
|
|
|
endpoint: 'users/following' as const,
|
|
|
|
limit: 20,
|
|
|
|
params: computed(() => ({
|
|
|
|
userId: props.user.id,
|
|
|
|
})),
|
|
|
|
};
|
2020-01-29 21:37:25 +02:00
|
|
|
|
2022-01-12 19:46:14 +02:00
|
|
|
const followersPagination = {
|
|
|
|
endpoint: 'users/followers' as const,
|
|
|
|
limit: 20,
|
|
|
|
params: computed(() => ({
|
|
|
|
userId: props.user.id,
|
|
|
|
})),
|
|
|
|
};
|
2020-01-29 21:37:25 +02:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.mk-following-or-followers {
|
2020-10-17 14:12:00 +03:00
|
|
|
> .users {
|
|
|
|
display: grid;
|
|
|
|
grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
|
|
|
|
grid-gap: var(--margin);
|
2020-01-29 21:37:25 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|