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