From af66b518cb0d54c0bff4d4998c9fcb31f7aacd1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Tue, 4 Dec 2018 16:58:35 +0100 Subject: [PATCH] Add empty content component MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- src/views/Timeline.vue | 40 +++++++++++++++++++++++++++++++++------- 1 file changed, 33 insertions(+), 7 deletions(-) diff --git a/src/views/Timeline.vue b/src/views/Timeline.vue index dd5016ea..6479a59b 100644 --- a/src/views/Timeline.vue +++ b/src/views/Timeline.vue @@ -17,11 +17,7 @@
-
- -

{{ t('social', 'No posts found') }}

-

{{ t('social', 'Posts from people you follow will show up here') }}

-
+
@@ -91,6 +87,7 @@ import InfiniteLoading from 'vue-infinite-loading' import TimelineEntry from './../components/TimelineEntry' import Composer from './../components/Composer' import CurrentUserMixin from './../mixins/currentUserMixin' +import EmptyContent from './../components/EmptyContent' export default { name: 'Timeline', @@ -100,16 +97,45 @@ export default { TimelineEntry, Multiselect, Composer, - InfiniteLoading + InfiniteLoading, + EmptyContent }, mixins: [CurrentUserMixin], data: function() { return { infoHidden: false, - state: [] + state: [], + emptyContent: { + default: { + image: 'img/undraw/posts.svg', + title: t('social', 'No posts found'), + description: t('social', 'Posts from people you follow will show up here') + }, + direct: { + image: 'img/undraw/direct.svg', + title: t('social', 'No posts found'), + description: t('social', 'Posts directed to you will show up here') + }, + timeline: { + image: 'img/undraw/local.svg', + title: t('social', 'No posts found'), + description: t('social', 'Posts from this instance will show up here') + }, + federated: { + image: 'img/undraw/global.svg', + title: t('social', 'No posts found'), + description: t('social', 'Posts from federated instances will show up here') + } + } } }, computed: { + emptyContentData() { + if (typeof this.emptyContent[this.$route.params.type] !== 'undefined') { + return this.emptyContent[this.$route.params.type] + } + return this.emptyContent.default + }, type: function() { if (this.$route.params.type) { return this.$route.params.type