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