summaryrefslogtreecommitdiff
path: root/src/client/app/common
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-06-08 20:57:02 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-06-08 20:57:02 +0900
commit724e812972cdaf55b0c2e8d3ebbb31637c405f57 (patch)
treebb676df9f3077a1b51ba82dfb8d360760f774e54 /src/client/app/common
parentNew: Zen mode (diff)
downloadmisskey-724e812972cdaf55b0c2e8d3ebbb31637c405f57.tar.gz
misskey-724e812972cdaf55b0c2e8d3ebbb31637c405f57.tar.bz2
misskey-724e812972cdaf55b0c2e8d3ebbb31637c405f57.zip
Refactor
Diffstat (limited to 'src/client/app/common')
-rw-r--r--src/client/app/common/views/components/index.ts2
-rw-r--r--src/client/app/common/views/components/note-header.vue112
2 files changed, 114 insertions, 0 deletions
diff --git a/src/client/app/common/views/components/index.ts b/src/client/app/common/views/components/index.ts
index f30e3f953b..803854468e 100644
--- a/src/client/app/common/views/components/index.ts
+++ b/src/client/app/common/views/components/index.ts
@@ -2,6 +2,7 @@ import Vue from 'vue';
import analogClock from './analog-clock.vue';
import menu from './menu.vue';
+import noteHeader from './note-header.vue';
import signin from './signin.vue';
import signup from './signup.vue';
import forkit from './forkit.vue';
@@ -31,6 +32,7 @@ import welcomeTimeline from './welcome-timeline.vue';
Vue.component('mk-analog-clock', analogClock);
Vue.component('mk-menu', menu);
+Vue.component('mk-note-header', noteHeader);
Vue.component('mk-signin', signin);
Vue.component('mk-signup', signup);
Vue.component('mk-forkit', forkit);
diff --git a/src/client/app/common/views/components/note-header.vue b/src/client/app/common/views/components/note-header.vue
new file mode 100644
index 0000000000..611a14f73d
--- /dev/null
+++ b/src/client/app/common/views/components/note-header.vue
@@ -0,0 +1,112 @@
+<template>
+<header class="bvonvjxbwzaiskogyhbwgyxvcgserpmu">
+ <mk-avatar class="avatar" :user="note.user" v-if="$store.state.device.postStyle == 'smart'"/>
+ <router-link class="name" :to="note.user | userPage" v-user-preview="note.user.id">{{ note.user | userName }}</router-link>
+ <span class="is-admin" v-if="note.user.isAdmin">admin</span>
+ <span class="is-bot" v-if="note.user.isBot">bot</span>
+ <span class="is-cat" v-if="note.user.isCat">cat</span>
+ <span class="username"><mk-acct :user="note.user"/></span>
+ <div class="info">
+ <span class="app" v-if="note.app">via <b>{{ note.app.name }}</b></span>
+ <span class="mobile" v-if="note.viaMobile">%fa:mobile-alt%</span>
+ <router-link class="created-at" :to="note | notePage">
+ <mk-time :time="note.createdAt"/>
+ </router-link>
+ <span class="visibility" v-if="note.visibility != 'public'">
+ <template v-if="note.visibility == 'home'">%fa:home%</template>
+ <template v-if="note.visibility == 'followers'">%fa:unlock%</template>
+ <template v-if="note.visibility == 'specified'">%fa:envelope%</template>
+ <template v-if="note.visibility == 'private'">%fa:lock%</template>
+ </span>
+ </div>
+</header>
+</template>
+
+<script lang="ts">
+import Vue from 'vue';
+
+export default Vue.extend({
+ props: {
+ note: {
+ type: Object,
+ required: true
+ }
+ }
+});
+</script>
+
+<style lang="stylus" scoped>
+@import '~const.styl'
+
+root(isDark)
+ display flex
+ align-items baseline
+ white-space nowrap
+
+ > .avatar
+ flex-shrink 0
+ margin-right 8px
+ width 20px
+ height 20px
+ border-radius 100%
+
+ > .name
+ display block
+ margin 0 .5em 0 0
+ padding 0
+ overflow hidden
+ color isDark ? #fff : #627079
+ font-size 1em
+ font-weight bold
+ text-decoration none
+ text-overflow ellipsis
+
+ &:hover
+ text-decoration underline
+
+ > .is-admin
+ > .is-bot
+ > .is-cat
+ align-self center
+ margin 0 .5em 0 0
+ padding 1px 6px
+ font-size 12px
+ color isDark ? #758188 : #aaa
+ border solid 1px isDark ? #57616f : #ddd
+ border-radius 3px
+
+ &.is-admin
+ border-color isDark ? #d42c41 : #f56a7b
+ color isDark ? #d42c41 : #f56a7b
+
+ > .username
+ margin 0 .5em 0 0
+ overflow hidden
+ text-overflow ellipsis
+ color isDark ? #606984 : #ccc
+
+ > .info
+ margin-left auto
+ font-size 0.9em
+
+ > *
+ color isDark ? #606984 : #c0c0c0
+
+ > .mobile
+ margin-right 8px
+
+ > .app
+ margin-right 8px
+ padding-right 8px
+ border-right solid 1px isDark ? #1c2023 : #eaeaea
+
+ > .visibility
+ margin-left 8px
+
+.bvonvjxbwzaiskogyhbwgyxvcgserpmu[data-darkmode]
+ root(true)
+
+.bvonvjxbwzaiskogyhbwgyxvcgserpmu:not([data-darkmode])
+ root(false)
+
+</style>