2019-11-24 14:16:24 +01:00
|
|
|
<template>
|
2020-09-05 22:35:52 +02:00
|
|
|
<div :class="{'is-inline': isInline}" class="user">
|
|
|
|
<img
|
|
|
|
:height="avatarSize"
|
|
|
|
:src="user.getAvatarUrl(avatarSize)"
|
|
|
|
:width="avatarSize"
|
|
|
|
alt=""
|
|
|
|
class="avatar"
|
|
|
|
v-tooltip="user.username"/>
|
|
|
|
<span class="username" v-if="showUsername">{{ user.username }}</span>
|
2019-11-24 14:16:24 +01:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2020-09-05 22:35:52 +02:00
|
|
|
export default {
|
|
|
|
name: 'user',
|
|
|
|
props: {
|
|
|
|
user: {
|
|
|
|
required: true,
|
|
|
|
type: Object,
|
2019-11-24 14:16:24 +01:00
|
|
|
},
|
2020-09-05 22:35:52 +02:00
|
|
|
showUsername: {
|
|
|
|
required: false,
|
|
|
|
type: Boolean,
|
|
|
|
default: true,
|
|
|
|
},
|
|
|
|
avatarSize: {
|
|
|
|
required: false,
|
|
|
|
type: Number,
|
|
|
|
default: 50,
|
|
|
|
},
|
|
|
|
isInline: {
|
|
|
|
required: false,
|
|
|
|
type: Boolean,
|
|
|
|
default: false,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
2019-11-24 14:16:24 +01:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
2020-09-05 22:35:52 +02:00
|
|
|
.user {
|
|
|
|
margin: .5em;
|
2019-11-24 14:16:24 +01:00
|
|
|
|
2020-09-05 22:35:52 +02:00
|
|
|
&.is-inline {
|
|
|
|
display: inline;
|
|
|
|
}
|
2020-04-01 22:13:57 +02:00
|
|
|
|
2020-09-05 22:35:52 +02:00
|
|
|
img {
|
|
|
|
-webkit-border-radius: 100%;
|
|
|
|
-moz-border-radius: 100%;
|
|
|
|
border-radius: 100%;
|
2019-11-24 14:16:24 +01:00
|
|
|
|
2020-09-05 22:35:52 +02:00
|
|
|
vertical-align: middle;
|
|
|
|
margin-right: .5em;
|
2019-11-24 14:16:24 +01:00
|
|
|
}
|
2020-09-05 22:35:52 +02:00
|
|
|
}
|
2019-11-24 14:16:24 +01:00
|
|
|
</style>
|