2023-07-27 05:31:52 +00:00
|
|
|
<!--
|
|
|
|
SPDX-FileCopyrightText: syuilo and other misskey contributors
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
-->
|
|
|
|
|
2020-01-29 19:37:25 +00:00
|
|
|
<template>
|
2020-11-25 12:31:34 +00:00
|
|
|
<div>
|
2023-05-19 11:52:15 +00:00
|
|
|
<MkPagination v-slot="{items}" ref="list" :pagination="type === 'following' ? followingPagination : followersPagination">
|
|
|
|
<div :class="$style.users">
|
|
|
|
<MkUserInfo v-for="user in items.map(x => type === 'following' ? x.followee : x.follower)" :key="user.id" :user="user"/>
|
2020-01-29 19:37:25 +00:00
|
|
|
</div>
|
2020-10-17 11:12:00 +00:00
|
|
|
</MkPagination>
|
|
|
|
</div>
|
2020-01-29 19:37:25 +00:00
|
|
|
</template>
|
|
|
|
|
2022-01-12 17:46:14 +00:00
|
|
|
<script lang="ts" setup>
|
|
|
|
import { computed } from 'vue';
|
2023-09-04 04:33:38 +00:00
|
|
|
import * as Misskey from 'misskey-js';
|
2022-08-30 15:24:33 +00:00
|
|
|
import MkUserInfo from '@/components/MkUserInfo.vue';
|
2022-09-06 09:21:49 +00:00
|
|
|
import MkPagination from '@/components/MkPagination.vue';
|
2020-01-29 19:37:25 +00:00
|
|
|
|
2022-01-12 17:46:14 +00:00
|
|
|
const props = defineProps<{
|
2023-09-04 04:33:38 +00:00
|
|
|
user: Misskey.entities.User;
|
2022-01-12 17:46:14 +00:00
|
|
|
type: 'following' | 'followers';
|
|
|
|
}>();
|
2020-01-29 19:37:25 +00:00
|
|
|
|
2022-01-12 17:46:14 +00:00
|
|
|
const followingPagination = {
|
|
|
|
endpoint: 'users/following' as const,
|
|
|
|
limit: 20,
|
|
|
|
params: computed(() => ({
|
|
|
|
userId: props.user.id,
|
|
|
|
})),
|
|
|
|
};
|
2020-01-29 19:37:25 +00:00
|
|
|
|
2022-01-12 17:46:14 +00:00
|
|
|
const followersPagination = {
|
|
|
|
endpoint: 'users/followers' as const,
|
|
|
|
limit: 20,
|
|
|
|
params: computed(() => ({
|
|
|
|
userId: props.user.id,
|
|
|
|
})),
|
|
|
|
};
|
2020-01-29 19:37:25 +00:00
|
|
|
</script>
|
|
|
|
|
2023-05-19 11:52:15 +00:00
|
|
|
<style lang="scss" module>
|
|
|
|
.users {
|
|
|
|
display: grid;
|
|
|
|
grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
|
|
|
|
grid-gap: var(--margin);
|
2020-01-29 19:37:25 +00:00
|
|
|
}
|
|
|
|
</style>
|