From 4d950ca6be40c6e1be41c8a44593aba4387c90d4 Mon Sep 17 00:00:00 2001 From: Grzegorz Leoniec Date: Tue, 16 Oct 2018 11:18:07 +0200 Subject: [PATCH] mock following count increase --- components/Author.vue | 27 ++++++++++++++++++++++----- components/FollowButton.vue | 7 ++----- 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/components/Author.vue b/components/Author.vue index 441efa3d5..9eb5d2b58 100644 --- a/components/Author.vue +++ b/components/Author.vue @@ -2,7 +2,7 @@ @@ -14,7 +14,7 @@ {{ author.name }} + size="32px" /> {{ author.name | truncate(trunc) }}
{{ author.followedByCount }} + style="margin-bottom: 0; text-align: center">{{ fanCount }} Fans + - + @@ -83,14 +90,24 @@ export default { }, props: { post: { type: Object, default: null }, + trunc: { type: Number, default: null }, showAuthorPopover: { type: Boolean, default: true } }, data() { return { - isPopoverOpen: false + isPopoverOpen: false, + voted: false } }, computed: { + fanCount() { + let count = Number(this.author.followedByCount) || 0 + if (this.voted) { + // NOTE: this is used for presentation + count += 1 + } + return count + }, author() { return this.hasAuthor ? this.post.author.User diff --git a/components/FollowButton.vue b/components/FollowButton.vue index 012def236..a174fac80 100644 --- a/components/FollowButton.vue +++ b/components/FollowButton.vue @@ -1,6 +1,6 @@