2018-02-15 02:33:34 -07:00
|
|
|
<template>
|
|
|
|
<div class="mk-user-home-friends">
|
|
|
|
<p class="initializing" v-if="fetching">%fa:spinner .pulse .fw%%i18n:mobile.tags.mk-user-overview-frequently-replied-users.loading%<mk-ellipsis/></p>
|
|
|
|
<div v-if="!fetching && users.length > 0">
|
|
|
|
<mk-user-card v-for="user in users" :key="user.id" :user="user"/>
|
|
|
|
</div>
|
|
|
|
<p class="empty" v-if="!fetching && users.length == 0">%i18n:mobile.tags.mk-user-overview-frequently-replied-users.no-users%</p>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import Vue from 'vue';
|
|
|
|
export default Vue.extend({
|
|
|
|
props: ['user'],
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
fetching: true,
|
|
|
|
users: []
|
|
|
|
};
|
|
|
|
},
|
|
|
|
mounted() {
|
2018-02-17 20:35:18 -07:00
|
|
|
(this as any).api('users/get_frequently_replied_users', {
|
2018-02-15 02:33:34 -07:00
|
|
|
user_id: this.user.id
|
|
|
|
}).then(res => {
|
|
|
|
this.users = res.map(x => x.user);
|
2018-02-19 07:37:09 -07:00
|
|
|
this.fetching = false;
|
2018-02-15 02:33:34 -07:00
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="stylus" scoped>
|
|
|
|
.mk-user-home-friends
|
|
|
|
> div
|
|
|
|
overflow-x scroll
|
|
|
|
-webkit-overflow-scrolling touch
|
|
|
|
white-space nowrap
|
|
|
|
padding 8px
|
|
|
|
|
2018-02-16 11:01:00 -07:00
|
|
|
> .mk-user-card
|
2018-02-15 02:33:34 -07:00
|
|
|
&:not(:last-child)
|
|
|
|
margin-right 8px
|
|
|
|
|
|
|
|
> .initializing
|
|
|
|
> .empty
|
|
|
|
margin 0
|
|
|
|
padding 16px
|
|
|
|
text-align center
|
|
|
|
color #aaa
|
|
|
|
|
|
|
|
> i
|
|
|
|
margin-right 4px
|
|
|
|
|
|
|
|
</style>
|