2019-09-17 16:36:11 +00:00
|
|
|
<template>
|
|
|
|
<div v-if="item.actor_info" class="post-avatar">
|
2022-09-12 13:42:18 +00:00
|
|
|
<NcAvatar v-if="item.local"
|
2022-06-20 12:31:44 +00:00
|
|
|
class="messages__avatar__icon"
|
|
|
|
:show-user-status="false"
|
|
|
|
menu-position="left"
|
|
|
|
:user="userTest"
|
|
|
|
:display-name="item.actor_info.account"
|
|
|
|
:disable-tooltip="true" />
|
2022-09-12 13:42:18 +00:00
|
|
|
<NcAvatar v-else
|
2022-06-20 12:31:44 +00:00
|
|
|
:url="avatarUrl"
|
2019-09-17 16:36:11 +00:00
|
|
|
:disable-tooltip="true" />
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2022-09-12 13:42:18 +00:00
|
|
|
import NcAvatar from '@nextcloud/vue/dist/Components/NcAvatar.js'
|
2019-09-17 16:36:11 +00:00
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'TimelineAvatar',
|
|
|
|
components: {
|
2022-09-12 13:42:18 +00:00
|
|
|
NcAvatar,
|
2019-09-17 16:36:11 +00:00
|
|
|
},
|
|
|
|
props: {
|
2022-06-20 12:31:44 +00:00
|
|
|
item: {
|
|
|
|
type: Object,
|
|
|
|
default: () => {},
|
|
|
|
},
|
2019-09-17 16:36:11 +00:00
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
userTest() {
|
|
|
|
return this.item.actor_info.preferredUsername
|
|
|
|
},
|
|
|
|
avatarUrl() {
|
|
|
|
return OC.generateUrl('/apps/social/api/v1/global/actor/avatar?id=' + this.item.attributedTo)
|
2022-06-20 12:31:44 +00:00
|
|
|
},
|
|
|
|
},
|
2019-09-17 16:36:11 +00:00
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
2022-06-20 12:31:44 +00:00
|
|
|
<style scoped>
|
2019-09-17 16:36:11 +00:00
|
|
|
.post-avatar {
|
2022-06-20 12:31:44 +00:00
|
|
|
position: relative;
|
2022-10-27 11:49:47 +00:00
|
|
|
padding: 5px 10px 10px 5px;
|
2022-06-20 12:31:44 +00:00
|
|
|
height: 52px;
|
|
|
|
width: 52px;
|
2019-09-17 16:36:11 +00:00
|
|
|
}
|
|
|
|
</style>
|