This commit is contained in:
syuilo 2018-06-23 23:18:39 +09:00
parent 31ea8d23dc
commit 20b0a65ad4
3 changed files with 15 additions and 13 deletions

View File

@ -6,10 +6,10 @@
<div class="title">
<p class="name">{{ user | userName }}</p>
<div>
<p v-if="user.isBot" title="%i18n:@is-bot%">%fa:robot%</p>
<p class="username"><mk-acct :user="user"/></p>
<p class="location" v-if="user.host === null && user.profile.location">%fa:map-marker% {{ user.profile.location }}</p>
<p class="birthday" v-if="user.host === null && user.profile.birthday">%fa:birthday-cake% {{ user.profile.birthday.replace('-', '').replace('-', '') + '' }} ({{ age }})</p>
<span class="username"><mk-acct :user="user"/></span>
<span v-if="user.isBot" title="%i18n:@is-bot%">%fa:robot%</span>
<span class="location" v-if="user.host === null && user.profile.location">%fa:map-marker% {{ user.profile.location }}</span>
<span class="birthday" v-if="user.host === null && user.profile.birthday">%fa:birthday-cake% {{ user.profile.birthday.replace('-', '').replace('-', '') + '' }} ({{ age }})</span>
</div>
</div>
</div>
@ -31,6 +31,7 @@
import Vue from 'vue';
import MkFollowingWindow from '../../components/following-window.vue';
import MkFollowersWindow from '../../components/followers-window.vue';
import * as age from 's-age';
export default Vue.extend({
props: ['user'],
@ -41,6 +42,10 @@ export default Vue.extend({
backgroundColor: this.user.bannerColor && this.user.bannerColor.length == 3 ? `rgb(${ this.user.bannerColor.join(',') })` : null,
backgroundImage: `url(${ this.user.bannerUrl })`
};
},
age(): number {
return age(this.user.profile.birthday);
}
},
mounted() {
@ -154,10 +159,13 @@ root(isDark)
> div
> *
display inline-block
margin 0 16px 0 0
margin-right 16px
line-height 20px
opacity 0.8
&.username
font-weight bold
> .avatar
display block
position absolute

View File

@ -20,18 +20,12 @@
<script lang="ts">
import Vue from 'vue';
import * as age from 's-age';
import MkUserListsWindow from '../../components/user-lists-window.vue';
export default Vue.extend({
props: ['user'],
computed: {
age(): number {
return age(this.user.profile.birthday);
}
},
methods: {
methods: {
stalk() {
(this as any).api('following/stalk', {
userId: this.user.id

View File

@ -11,7 +11,7 @@
</div>
<div class="side">
<x-profile :user="user"/>
<a-twitter :user="user" v-if="user.host === null && user.twitter"/>
<x-twitter :user="user" v-if="user.host === null && user.twitter"/>
<mk-calendar @chosen="warp" :start="new Date(user.createdAt)"/>
<mk-activity :user="user"/>
<x-photos :user="user"/>