2018-03-16 20:33:36 +02:00
|
|
|
<template>
|
|
|
|
<div class="mk-welcome-timeline">
|
2018-04-07 20:30:37 +03:00
|
|
|
<div v-for="note in notes">
|
|
|
|
<router-link class="avatar-anchor" :to="`/@${getAcct(note.user)}`" v-user-preview="note.user.id">
|
|
|
|
<img class="avatar" :src="`${note.user.avatarUrl}?thumbnail&size=96`" alt="avatar"/>
|
2018-03-16 20:33:36 +02:00
|
|
|
</router-link>
|
|
|
|
<div class="body">
|
|
|
|
<header>
|
2018-04-07 20:30:37 +03:00
|
|
|
<router-link class="name" :to="`/@${getAcct(note.user)}`" v-user-preview="note.user.id">{{ getUserName(note.user) }}</router-link>
|
|
|
|
<span class="username">@{{ getAcct(note.user) }}</span>
|
2018-03-16 20:33:36 +02:00
|
|
|
<div class="info">
|
2018-04-07 20:30:37 +03:00
|
|
|
<router-link class="created-at" :to="`/@${getAcct(note.user)}/${note.id}`">
|
|
|
|
<mk-time :time="note.createdAt"/>
|
2018-03-16 20:33:36 +02:00
|
|
|
</router-link>
|
|
|
|
</div>
|
|
|
|
</header>
|
|
|
|
<div class="text">
|
2018-04-07 20:30:37 +03:00
|
|
|
<mk-note-html :text="note.text"/>
|
2018-03-16 20:33:36 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import Vue from 'vue';
|
2018-04-02 07:44:32 +03:00
|
|
|
import getAcct from '../../../../../acct/render';
|
2018-04-05 19:36:34 +03:00
|
|
|
import getUserName from '../../../../../renderers/get-user-name';
|
2018-03-16 20:33:36 +02:00
|
|
|
|
|
|
|
export default Vue.extend({
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
fetching: true,
|
2018-04-07 20:30:37 +03:00
|
|
|
notes: []
|
2018-03-16 20:33:36 +02:00
|
|
|
};
|
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
this.fetch();
|
|
|
|
},
|
|
|
|
methods: {
|
2018-03-27 10:51:12 +03:00
|
|
|
getAcct,
|
2018-04-05 19:36:34 +03:00
|
|
|
getUserName,
|
2018-03-16 20:33:36 +02:00
|
|
|
fetch(cb?) {
|
|
|
|
this.fetching = true;
|
2018-04-07 20:30:37 +03:00
|
|
|
(this as any).api('notes', {
|
2018-03-16 20:33:36 +02:00
|
|
|
reply: false,
|
2018-04-07 20:30:37 +03:00
|
|
|
renote: false,
|
2018-03-16 20:33:36 +02:00
|
|
|
media: false,
|
|
|
|
poll: false,
|
|
|
|
bot: false
|
2018-04-07 20:30:37 +03:00
|
|
|
}).then(notes => {
|
|
|
|
this.notes = notes;
|
2018-03-16 20:33:36 +02:00
|
|
|
this.fetching = false;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="stylus" scoped>
|
|
|
|
.mk-welcome-timeline
|
|
|
|
background #fff
|
|
|
|
|
|
|
|
> div
|
|
|
|
padding 16px
|
|
|
|
overflow-wrap break-word
|
|
|
|
font-size .9em
|
|
|
|
color #4C4C4C
|
|
|
|
border-bottom 1px solid rgba(0, 0, 0, 0.05)
|
|
|
|
|
|
|
|
&:after
|
|
|
|
content ""
|
|
|
|
display block
|
|
|
|
clear both
|
|
|
|
|
|
|
|
> .avatar-anchor
|
|
|
|
display block
|
|
|
|
float left
|
|
|
|
position -webkit-sticky
|
|
|
|
position sticky
|
|
|
|
top 16px
|
|
|
|
|
|
|
|
> img
|
|
|
|
display block
|
2018-03-17 10:47:46 +02:00
|
|
|
width 42px
|
|
|
|
height 42px
|
2018-03-16 20:33:36 +02:00
|
|
|
border-radius 6px
|
|
|
|
|
|
|
|
> .body
|
|
|
|
float right
|
2018-03-17 10:47:46 +02:00
|
|
|
width calc(100% - 42px)
|
|
|
|
padding-left 12px
|
2018-03-16 20:33:36 +02:00
|
|
|
|
|
|
|
> header
|
|
|
|
display flex
|
|
|
|
align-items center
|
|
|
|
margin-bottom 4px
|
|
|
|
white-space nowrap
|
|
|
|
|
|
|
|
> .name
|
|
|
|
display block
|
|
|
|
margin 0 .5em 0 0
|
|
|
|
padding 0
|
|
|
|
overflow hidden
|
|
|
|
font-weight bold
|
|
|
|
text-overflow ellipsis
|
2018-03-17 16:01:17 +02:00
|
|
|
color #627079
|
2018-03-16 20:33:36 +02:00
|
|
|
|
|
|
|
> .username
|
|
|
|
margin 0 .5em 0 0
|
|
|
|
color #ccc
|
|
|
|
|
|
|
|
> .info
|
|
|
|
margin-left auto
|
|
|
|
font-size 0.9em
|
|
|
|
|
|
|
|
> .created-at
|
|
|
|
color #c0c0c0
|
|
|
|
|
|
|
|
</style>
|