2019-09-17 16:36:11 +00:00
|
|
|
<template>
|
2023-01-19 16:18:11 +00:00
|
|
|
<div v-if="item.account" class="post-avatar">
|
|
|
|
<NcAvatar v-if="isLocal"
|
2022-06-20 12:31:44 +00:00
|
|
|
class="messages__avatar__icon"
|
|
|
|
:show-user-status="false"
|
|
|
|
menu-position="left"
|
|
|
|
:user="userTest"
|
2023-01-19 16:18:11 +00:00
|
|
|
:display-name="item.account.acct"
|
|
|
|
:url="item.account.avatar"
|
2022-06-20 12:31:44 +00:00
|
|
|
:disable-tooltip="true" />
|
2022-09-12 13:42:18 +00:00
|
|
|
<NcAvatar v-else
|
2023-01-19 16:18:11 +00:00
|
|
|
:url="item.account.avatar"
|
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: {
|
2023-01-19 16:18:11 +00:00
|
|
|
/** @type {import('vue').PropType<import('../types/Mastodon.js').Status>} */
|
2022-06-20 12:31:44 +00:00
|
|
|
item: {
|
|
|
|
type: Object,
|
|
|
|
default: () => {},
|
|
|
|
},
|
2019-09-17 16:36:11 +00:00
|
|
|
},
|
|
|
|
computed: {
|
2023-01-19 16:18:11 +00:00
|
|
|
/**
|
|
|
|
* @return {string}
|
|
|
|
*/
|
2019-09-17 16:36:11 +00:00
|
|
|
userTest() {
|
2023-01-19 16:18:11 +00:00
|
|
|
return this.item.account.display_name
|
2019-09-17 16:36:11 +00:00
|
|
|
},
|
2023-01-19 16:18:11 +00:00
|
|
|
/** @return {boolean} */
|
|
|
|
isLocal() {
|
|
|
|
return !this.item.account.acct.includes('@')
|
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>
|