2018-02-14 12:47:40 +01:00
|
|
|
<template>
|
|
|
|
<div class="mk-user-card">
|
2018-03-29 07:48:47 +02:00
|
|
|
<header :style="user.bannerUrl ? `background-image: url(${user.bannerUrl}?thumbnail&size=1024)` : ''">
|
2018-03-27 09:51:12 +02:00
|
|
|
<a :href="`/@${acct}`">
|
2018-03-29 07:48:47 +02:00
|
|
|
<img :src="`${user.avatarUrl}?thumbnail&size=200`" alt="avatar"/>
|
2018-02-14 12:47:40 +01:00
|
|
|
</a>
|
|
|
|
</header>
|
2018-04-05 18:36:34 +02:00
|
|
|
<a class="name" :href="`/@${acct}`" target="_blank">{{ name }}</a>
|
2018-03-27 09:51:12 +02:00
|
|
|
<p class="username">@{{ acct }}</p>
|
2018-02-14 12:47:40 +01:00
|
|
|
<mk-follow-button :user="user"/>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import Vue from 'vue';
|
2018-04-02 06:44:32 +02:00
|
|
|
import getAcct from '../../../../../acct/render';
|
2018-04-05 18:36:34 +02:00
|
|
|
import getUserName from '../../../../../renderers/get-user-name';
|
2018-03-27 09:51:12 +02:00
|
|
|
|
2018-02-14 12:47:40 +01:00
|
|
|
export default Vue.extend({
|
2018-03-27 09:51:12 +02:00
|
|
|
props: ['user'],
|
|
|
|
computed: {
|
|
|
|
acct() {
|
|
|
|
return getAcct(this.user);
|
2018-04-05 18:36:34 +02:00
|
|
|
},
|
|
|
|
name() {
|
|
|
|
return getUserName(this.user);
|
2018-03-27 09:51:12 +02:00
|
|
|
}
|
|
|
|
}
|
2018-02-14 12:47:40 +01:00
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="stylus" scoped>
|
|
|
|
.mk-user-card
|
|
|
|
display inline-block
|
|
|
|
width 200px
|
|
|
|
text-align center
|
|
|
|
border-radius 8px
|
|
|
|
background #fff
|
|
|
|
|
|
|
|
> header
|
|
|
|
display block
|
|
|
|
height 80px
|
|
|
|
background-color #ddd
|
|
|
|
background-size cover
|
|
|
|
background-position center
|
|
|
|
border-radius 8px 8px 0 0
|
|
|
|
|
|
|
|
> a
|
|
|
|
> img
|
|
|
|
position absolute
|
|
|
|
top 20px
|
|
|
|
left calc(50% - 40px)
|
|
|
|
width 80px
|
|
|
|
height 80px
|
|
|
|
border solid 2px #fff
|
|
|
|
border-radius 8px
|
|
|
|
|
|
|
|
> .name
|
|
|
|
display block
|
|
|
|
margin 24px 0 0 0
|
|
|
|
font-size 16px
|
|
|
|
color #555
|
|
|
|
|
|
|
|
> .username
|
|
|
|
margin 0
|
|
|
|
font-size 15px
|
|
|
|
color #ccc
|
|
|
|
|
2018-02-16 19:01:00 +01:00
|
|
|
> .mk-follow-button
|
2018-02-14 12:47:40 +01:00
|
|
|
display inline-block
|
|
|
|
margin 8px 0 16px 0
|
|
|
|
|
|
|
|
</style>
|