コンポーネント整理

This commit is contained in:
syuilo
2019-02-19 03:38:34 +09:00
parent aeca115a37
commit 963b0db3d3
10 changed files with 43 additions and 450 deletions

View File

@@ -15,7 +15,6 @@ import notePreview from './note-preview.vue';
import noteDetail from './note-detail.vue';
import calendar from './calendar.vue';
import activity from './activity.vue';
import userCard from './user-card.vue';
import userListTimeline from './user-list-timeline.vue';
import uiContainer from './ui-container.vue';
@@ -34,6 +33,5 @@ Vue.component('mk-note-preview', notePreview);
Vue.component('mk-note-detail', noteDetail);
Vue.component('mk-calendar', calendar);
Vue.component('mk-activity', activity);
Vue.component('mk-user-card', userCard);
Vue.component('mk-user-list-timeline', userListTimeline);
Vue.component('ui-container', uiContainer);

View File

@@ -1,85 +0,0 @@
<template>
<div class="zvdbznxvfixtmujpsigoccczftvpiwqh">
<div class="banner" :style="bannerStyle"></div>
<mk-avatar class="avatar" :user="user" :disable-preview="true"/>
<mk-follow-button v-if="$store.getters.isSignedIn && user.id != $store.state.i.id" :user="user" class="follow" mini/>
<div class="body">
<router-link :to="user | userPage" class="name">
<mk-user-name :user="user"/>
</router-link>
<span class="username">@{{ user | acct }} <fa v-if="user.isLocked == true" class="locked" icon="lock" fixed-width/></span>
<div class="description">
<mfm v-if="user.description" :text="user.description" :is-note="false" :author="user" :i="$store.state.i" :custom-emojis="user.emojis"/>
</div>
</div>
</div>
</template>
<script lang="ts">
import Vue from 'vue';
export default Vue.extend({
props: ['user'],
computed: {
bannerStyle(): any {
if (this.user.bannerUrl == null) return {};
return {
backgroundColor: this.user.bannerColor && this.user.bannerColor.length == 3 ? `rgb(${ this.user.bannerColor.join(',') })` : null,
backgroundImage: `url(${ this.user.bannerUrl })`
};
}
},
});
</script>
<style lang="stylus" scoped>
.zvdbznxvfixtmujpsigoccczftvpiwqh
$bg = var(--face)
height 280px
overflow hidden
font-size 13px
background $bg
box-shadow 0 2px 4px rgba(0, 0, 0, 0.1)
color var(--faceText)
> .banner
height 90px
background-color #f9f4f4
background-position center
background-size cover
> .avatar
display block
margin -40px 0 0 16px
width 80px
height 80px
border-radius 100%
border solid 4px $bg
> .follow
position absolute
top 16px
right 16px
> .body
padding 0px 24px
margin-top -40px
> .name
font-size 120%
font-weight bold
> .username
display block
opacity 0.7
> .locked
opacity 0.8
> .description
margin 8px 0 16px 0
</style>