summaryrefslogtreecommitdiff
path: root/src/web
diff options
context:
space:
mode:
authorこぴなたみぽ <syuilotan@yahoo.co.jp>2018-02-16 20:53:15 +0900
committerこぴなたみぽ <syuilotan@yahoo.co.jp>2018-02-16 20:53:15 +0900
commite8f48bcec48219047845eb064752bd46d76b5578 (patch)
tree22ddafc96c41446ff943a361d8d9ccf436e6cf8f /src/web
parentwip (diff)
downloadmisskey-e8f48bcec48219047845eb064752bd46d76b5578.tar.gz
misskey-e8f48bcec48219047845eb064752bd46d76b5578.tar.bz2
misskey-e8f48bcec48219047845eb064752bd46d76b5578.zip
wip
Diffstat (limited to 'src/web')
-rw-r--r--src/web/app/mobile/tags/user-timeline.tag33
-rw-r--r--src/web/app/mobile/views/components/user-timeline.vue46
2 files changed, 46 insertions, 33 deletions
diff --git a/src/web/app/mobile/tags/user-timeline.tag b/src/web/app/mobile/tags/user-timeline.tag
deleted file mode 100644
index 546558155a..0000000000
--- a/src/web/app/mobile/tags/user-timeline.tag
+++ /dev/null
@@ -1,33 +0,0 @@
-<mk-user-timeline>
- <mk-timeline ref="timeline" init={ init } more={ more } empty={ withMedia ? '%i18n:mobile.tags.mk-user-timeline.no-posts-with-media%' : '%i18n:mobile.tags.mk-user-timeline.no-posts%' }/>
- <style lang="stylus" scoped>
- :scope
- display block
- max-width 600px
- margin 0 auto
- </style>
- <script lang="typescript">
- this.mixin('api');
-
- this.user = this.opts.user;
- this.withMedia = this.opts.withMedia;
-
- this.init = new Promise((res, rej) => {
- this.$root.$data.os.api('users/posts', {
- user_id: this.user.id,
- with_media: this.withMedia
- }).then(posts => {
- res(posts);
- this.$emit('loaded');
- });
- });
-
- this.more = () => {
- return this.$root.$data.os.api('users/posts', {
- user_id: this.user.id,
- with_media: this.withMedia,
- until_id: this.$refs.timeline.tail().id
- });
- };
- </script>
-</mk-user-timeline>
diff --git a/src/web/app/mobile/views/components/user-timeline.vue b/src/web/app/mobile/views/components/user-timeline.vue
new file mode 100644
index 0000000000..9a31ace4d1
--- /dev/null
+++ b/src/web/app/mobile/views/components/user-timeline.vue
@@ -0,0 +1,46 @@
+<template>
+<div class="mk-user-timeline">
+ <mk-posts :posts="posts">
+ <div class="init" v-if="fetching">
+ %fa:spinner .pulse%%i18n:common.loading%
+ </div>
+ <div class="empty" v-if="!fetching && posts.length == 0">
+ %fa:R comments%
+ {{ withMedia ? '%i18n:mobile.tags.mk-user-timeline.no-posts-with-media%' : '%i18n:mobile.tags.mk-user-timeline.no-posts%' }}
+ </div>
+ <button v-if="canFetchMore" @click="more" :disabled="fetching" slot="tail">
+ <span v-if="!fetching">%i18n:mobile.tags.mk-user-timeline.load-more%</span>
+ <span v-if="fetching">%i18n:common.loading%<mk-ellipsis/></span>
+ </button>
+ </mk-posts>
+</div>
+</template>
+
+<script lang="ts">
+import Vue from 'vue';
+export default Vue.extend({
+ props: ['user', 'withMedia'],
+ data() {
+ return {
+ fetching: true,
+ posts: []
+ };
+ },
+ mounted() {
+ this.$root.$data.os.api('users/posts', {
+ user_id: this.user.id,
+ with_media: this.withMedia
+ }).then(posts => {
+ this.fetching = false;
+ this.posts = posts;
+ this.$emit('loaded');
+ });
+ }
+});
+</script>
+
+<style lang="stylus" scoped>
+.mk-user-timeline
+ max-width 600px
+ margin 0 auto
+</style>