2020-01-29 11:37:25 -08:00
|
|
|
<template>
|
|
|
|
<mk-container :body-togglable="true" :expanded="expanded">
|
|
|
|
<template #header><slot></slot></template>
|
|
|
|
|
|
|
|
<mk-error v-if="error" @retry="init()"/>
|
|
|
|
|
|
|
|
<div class="efvhhmdq">
|
|
|
|
<div class="no-users" v-if="empty">
|
2020-07-24 09:36:39 -07:00
|
|
|
<p v-t="'noUsers'"></p>
|
2020-01-29 11:37:25 -08:00
|
|
|
</div>
|
|
|
|
<div class="user" v-for="user in users" :key="user.id">
|
|
|
|
<mk-avatar class="avatar" :user="user"/>
|
|
|
|
<div class="body">
|
|
|
|
<div class="name">
|
|
|
|
<router-link class="name" :to="user | userPage" v-user-preview="user.id"><mk-user-name :user="user"/></router-link>
|
|
|
|
<span class="username"><mk-acct :user="user"/></span>
|
|
|
|
</div>
|
|
|
|
<div class="description">
|
|
|
|
<mfm v-if="user.description" :text="user.description" :is-note="false" :author="user" :i="$store.state.i" :custom-emojis="user.emojis"/>
|
2020-07-24 09:36:39 -07:00
|
|
|
<span v-else class="empty" v-t="'noAccountDescription'"></span>
|
2020-01-29 11:37:25 -08:00
|
|
|
</div>
|
|
|
|
</div>
|
2020-01-30 18:35:18 -08:00
|
|
|
<mk-follow-button class="koudoku-button" v-if="$store.getters.isSignedIn && user.id != $store.state.i.id" :user="user" mini/>
|
2020-01-29 11:37:25 -08:00
|
|
|
</div>
|
2020-05-30 20:53:06 -07:00
|
|
|
<button class="more" ref="loadMore" :class="{ fetching: moreFetching }" v-show="more" :disabled="moreFetching">
|
2020-02-11 13:27:11 -08:00
|
|
|
<template v-if="moreFetching"><fa icon="spinner" pulse fixed-width/></template>{{ moreFetching ? $t('loading') : $t('loadMore') }}
|
2020-01-29 11:37:25 -08:00
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</mk-container>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import Vue from 'vue';
|
|
|
|
import paging from '../scripts/paging';
|
|
|
|
import MkContainer from './ui/container.vue';
|
2020-01-30 18:35:18 -08:00
|
|
|
import MkFollowButton from './follow-button.vue';
|
2020-01-29 11:37:25 -08:00
|
|
|
|
|
|
|
export default Vue.extend({
|
|
|
|
components: {
|
|
|
|
MkContainer,
|
2020-01-30 18:35:18 -08:00
|
|
|
MkFollowButton,
|
2020-01-29 11:37:25 -08:00
|
|
|
},
|
|
|
|
|
|
|
|
mixins: [
|
|
|
|
paging({}),
|
|
|
|
],
|
|
|
|
|
|
|
|
props: {
|
|
|
|
pagination: {
|
|
|
|
required: true
|
|
|
|
},
|
|
|
|
extract: {
|
|
|
|
required: false
|
|
|
|
},
|
|
|
|
expanded: {
|
|
|
|
type: Boolean,
|
|
|
|
default: true
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
computed: {
|
|
|
|
users() {
|
|
|
|
return this.extract ? this.extract(this.items) : this.items;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.efvhhmdq {
|
|
|
|
> .no-users {
|
|
|
|
text-align: center;
|
|
|
|
}
|
|
|
|
|
|
|
|
> .user {
|
|
|
|
position: relative;
|
|
|
|
display: flex;
|
|
|
|
padding: 16px;
|
|
|
|
border-bottom: solid 1px var(--divider);
|
|
|
|
|
|
|
|
&:last-child {
|
|
|
|
border-bottom: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
> .avatar {
|
|
|
|
display: block;
|
|
|
|
flex-shrink: 0;
|
|
|
|
margin: 0 12px 0 0;
|
|
|
|
width: 42px;
|
|
|
|
height: 42px;
|
|
|
|
border-radius: 8px;
|
|
|
|
}
|
|
|
|
|
|
|
|
> .body {
|
|
|
|
flex: 1;
|
|
|
|
|
|
|
|
> .name {
|
|
|
|
font-weight: bold;
|
|
|
|
|
|
|
|
> .name {
|
|
|
|
margin-right: 8px;
|
|
|
|
}
|
|
|
|
|
|
|
|
> .username {
|
|
|
|
opacity: 0.7;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
> .description {
|
|
|
|
font-size: 90%;
|
|
|
|
|
|
|
|
> .empty {
|
|
|
|
opacity: 0.7;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
> .koudoku-button {
|
|
|
|
flex-shrink: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
> .more {
|
|
|
|
display: block;
|
|
|
|
width: 100%;
|
|
|
|
padding: 16px;
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
background: rgba(#000, 0.025);
|
|
|
|
}
|
|
|
|
|
|
|
|
&:active {
|
|
|
|
background: rgba(#000, 0.05);
|
|
|
|
}
|
|
|
|
|
|
|
|
&.fetching {
|
|
|
|
cursor: wait;
|
|
|
|
}
|
|
|
|
|
|
|
|
> [data-icon] {
|
|
|
|
margin-right: 4px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|