2019-02-13 23:14:23 +11:00
|
|
|
<template>
|
2019-03-06 05:54:49 +11:00
|
|
|
<div class="basic-user-card">
|
2019-02-13 23:14:23 +11:00
|
|
|
<router-link :to="userProfileLink(user)">
|
2019-05-02 00:33:56 +10:00
|
|
|
<UserAvatar
|
|
|
|
class="avatar"
|
|
|
|
:user="user"
|
|
|
|
@click.prevent.native="toggleUserExpanded"
|
|
|
|
/>
|
2019-02-13 23:14:23 +11:00
|
|
|
</router-link>
|
2019-07-05 17:17:44 +10:00
|
|
|
<div
|
|
|
|
v-if="userExpanded"
|
|
|
|
class="basic-user-card-expanded-content"
|
|
|
|
>
|
|
|
|
<UserCard
|
|
|
|
:user="user"
|
|
|
|
:rounded="true"
|
|
|
|
:bordered="true"
|
|
|
|
/>
|
2019-02-13 23:14:23 +11:00
|
|
|
</div>
|
2019-07-05 17:17:44 +10:00
|
|
|
<div
|
|
|
|
v-else
|
|
|
|
class="basic-user-card-collapsed-content"
|
|
|
|
>
|
|
|
|
<div
|
|
|
|
:title="user.name"
|
|
|
|
class="basic-user-card-user-name"
|
|
|
|
>
|
|
|
|
<span
|
|
|
|
v-if="user.name_html"
|
|
|
|
class="basic-user-card-user-name-value"
|
|
|
|
v-html="user.name_html"
|
|
|
|
/>
|
|
|
|
<span
|
|
|
|
v-else
|
|
|
|
class="basic-user-card-user-name-value"
|
|
|
|
>{{ user.name }}</span>
|
2019-02-13 23:14:23 +11:00
|
|
|
</div>
|
2019-02-28 03:58:29 +11:00
|
|
|
<div>
|
2019-07-05 17:17:44 +10:00
|
|
|
<router-link
|
|
|
|
class="basic-user-card-screen-name"
|
|
|
|
:to="userProfileLink(user)"
|
|
|
|
>
|
|
|
|
@{{ user.screen_name }}
|
2019-02-28 03:58:29 +11:00
|
|
|
</router-link>
|
2019-02-13 23:14:23 +11:00
|
|
|
</div>
|
2019-07-05 17:17:44 +10:00
|
|
|
<slot />
|
2019-02-13 23:14:23 +11:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script src="./basic_user_card.js"></script>
|
|
|
|
|
|
|
|
<style lang="scss">
|
2019-03-06 05:54:49 +11:00
|
|
|
.basic-user-card {
|
2019-02-13 23:14:23 +11:00
|
|
|
display: flex;
|
|
|
|
flex: 1 0;
|
2019-03-05 18:32:23 +11:00
|
|
|
margin: 0;
|
2019-04-04 14:42:24 +11:00
|
|
|
padding: 0.6em 1em;
|
2019-02-13 23:14:23 +11:00
|
|
|
|
2019-02-14 06:31:02 +11:00
|
|
|
&-collapsed-content {
|
|
|
|
margin-left: 0.7em;
|
|
|
|
text-align: left;
|
|
|
|
flex: 1;
|
2019-03-01 04:48:14 +11:00
|
|
|
min-width: 0;
|
2019-02-26 22:57:29 +11:00
|
|
|
}
|
|
|
|
|
|
|
|
&-user-name {
|
|
|
|
img {
|
|
|
|
object-fit: contain;
|
|
|
|
height: 16px;
|
|
|
|
width: 16px;
|
|
|
|
vertical-align: middle;
|
2019-02-14 06:31:02 +11:00
|
|
|
}
|
2019-04-30 03:20:03 +10:00
|
|
|
}
|
2019-03-22 04:06:37 +11:00
|
|
|
|
2019-04-30 03:20:03 +10:00
|
|
|
&-user-name-value,
|
|
|
|
&-screen-name {
|
|
|
|
display: inline-block;
|
|
|
|
max-width: 100%;
|
|
|
|
overflow: hidden;
|
|
|
|
white-space: nowrap;
|
|
|
|
text-overflow: ellipsis;
|
2019-02-14 06:31:02 +11:00
|
|
|
}
|
2019-02-13 23:14:23 +11:00
|
|
|
|
2019-02-14 06:31:02 +11:00
|
|
|
&-expanded-content {
|
|
|
|
flex: 1;
|
2019-02-26 14:50:34 +11:00
|
|
|
margin-left: 0.7em;
|
2019-02-13 23:14:23 +11:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|