2020-01-29 11:37:25 -08:00
|
|
|
<template>
|
2020-10-17 04:12:00 -07:00
|
|
|
<div class="mk-users-dialog">
|
|
|
|
<div class="header">
|
|
|
|
<span>{{ title }}</span>
|
|
|
|
<button class="_button" @click="close()"><Fa :icon="faTimes"/></button>
|
|
|
|
</div>
|
2020-01-29 11:37:25 -08:00
|
|
|
|
2020-10-17 04:12:00 -07:00
|
|
|
<div class="users">
|
2020-10-24 09:21:41 -07:00
|
|
|
<MkA v-for="item in items" class="user" :key="item.id" :to="userPage(extract ? extract(item) : item)">
|
2020-10-17 04:12:00 -07:00
|
|
|
<MkAvatar :user="extract ? extract(item) : item" class="avatar" :disable-link="true"/>
|
|
|
|
<div class="body">
|
|
|
|
<MkUserName :user="extract ? extract(item) : item" class="name"/>
|
|
|
|
<MkAcct :user="extract ? extract(item) : item" class="acct"/>
|
|
|
|
</div>
|
2020-10-24 09:21:41 -07:00
|
|
|
</MkA>
|
2020-10-17 04:12:00 -07:00
|
|
|
</div>
|
2020-12-18 17:55:52 -08:00
|
|
|
<button class="more _button" v-appear="$store.state.enableInfiniteScroll ? fetchMore : null" @click="fetchMore" v-show="more" :disabled="moreFetching">
|
2020-10-17 04:12:00 -07:00
|
|
|
<template v-if="!moreFetching">{{ $t('loadMore') }}</template>
|
|
|
|
<template v-if="moreFetching"><Fa :icon="faSpinner" pulse fixed-width/></template>
|
|
|
|
</button>
|
2020-01-29 11:37:25 -08:00
|
|
|
|
2020-10-17 04:12:00 -07:00
|
|
|
<p class="empty" v-if="empty">{{ $t('noUsers') }}</p>
|
2020-01-29 11:37:25 -08:00
|
|
|
|
2020-10-17 04:12:00 -07:00
|
|
|
<MkError v-if="error" @retry="init()"/>
|
|
|
|
</div>
|
2020-01-29 11:37:25 -08:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
2020-10-17 04:12:00 -07:00
|
|
|
import { defineComponent } from 'vue';
|
2020-01-29 11:37:25 -08:00
|
|
|
import { faTimes } from '@fortawesome/free-solid-svg-icons';
|
2020-10-17 04:12:00 -07:00
|
|
|
import paging from '@/scripts/paging';
|
|
|
|
import { userPage } from '../filters/user';
|
2020-01-29 11:37:25 -08:00
|
|
|
|
2020-10-17 04:12:00 -07:00
|
|
|
export default defineComponent({
|
2020-01-29 11:37:25 -08:00
|
|
|
mixins: [
|
|
|
|
paging({}),
|
|
|
|
],
|
|
|
|
|
|
|
|
props: {
|
|
|
|
title: {
|
|
|
|
required: true
|
|
|
|
},
|
|
|
|
pagination: {
|
|
|
|
required: true
|
|
|
|
},
|
|
|
|
extract: {
|
|
|
|
required: false
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
faTimes
|
|
|
|
};
|
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
2020-10-17 04:12:00 -07:00
|
|
|
userPage
|
2020-01-29 11:37:25 -08:00
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.mk-users-dialog {
|
|
|
|
width: 350px;
|
|
|
|
height: 350px;
|
|
|
|
background: var(--panel);
|
|
|
|
border-radius: var(--radius);
|
|
|
|
overflow: hidden;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
|
|
> .header {
|
|
|
|
display: flex;
|
|
|
|
flex-shrink: 0;
|
|
|
|
|
|
|
|
> button {
|
|
|
|
height: 58px;
|
|
|
|
width: 58px;
|
|
|
|
|
|
|
|
@media (max-width: 500px) {
|
|
|
|
height: 42px;
|
|
|
|
width: 42px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
> span {
|
|
|
|
flex: 1;
|
|
|
|
line-height: 58px;
|
|
|
|
padding-left: 32px;
|
|
|
|
font-weight: bold;
|
|
|
|
|
|
|
|
@media (max-width: 500px) {
|
|
|
|
line-height: 42px;
|
|
|
|
padding-left: 16px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
> .users {
|
|
|
|
flex: 1;
|
|
|
|
overflow: auto;
|
|
|
|
|
|
|
|
&:empty {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
> .user {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
font-size: 14px;
|
|
|
|
padding: 8px 32px;
|
|
|
|
|
|
|
|
@media (max-width: 500px) {
|
|
|
|
padding: 8px 16px;
|
|
|
|
}
|
|
|
|
|
|
|
|
> * {
|
|
|
|
pointer-events: none;
|
|
|
|
user-select: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
> .avatar {
|
|
|
|
width: 45px;
|
|
|
|
height: 45px;
|
|
|
|
}
|
|
|
|
|
|
|
|
> .body {
|
|
|
|
padding: 0 8px;
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
|
|
> .name {
|
|
|
|
display: block;
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
|
|
|
|
|
|
|
> .acct {
|
|
|
|
opacity: 0.5;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
> .empty {
|
|
|
|
text-align: center;
|
|
|
|
opacity: 0.5;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|