summaryrefslogtreecommitdiff
path: root/src/client/app/mobile/views/components/user-card.vue
blob: 542ad20317e54d77659f430374b5554388802e5b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<template>
<div class="mk-user-card">
	<header :style="user.bannerUrl ? `background-image: url(${user.bannerUrl}?thumbnail&size=1024)` : ''">
		<a :href="`/@${acct}`">
			<img :src="`${user.avatarUrl}?thumbnail&size=200`" alt="avatar"/>
		</a>
	</header>
	<a class="name" :href="`/@${acct}`" target="_blank">{{ user.name }}</a>
	<p class="username">@{{ acct }}</p>
	<mk-follow-button :user="user"/>
</div>
</template>

<script lang="ts">
import Vue from 'vue';
import getAcct from '../../../../../user/get-acct';

export default Vue.extend({
	props: ['user'],
	computed: {
		acct() {
			return getAcct(this.user);
		}
	}
});
</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

	> .mk-follow-button
		display inline-block
		margin 8px 0 16px 0

</style>