Show status of follows and shouts for currently logged in user

This commit is contained in:
Grzegorz Leoniec 2019-03-03 19:30:54 +01:00
parent fe99629fe8
commit 76c4e4cd8f
No known key found for this signature in database
GPG Key ID: 3AA43686D4EB1377
8 changed files with 17 additions and 4 deletions

View File

@ -107,6 +107,7 @@
<ds-flex-item :width="{base: 3}">
<hc-follow-button
:follow-id="author.id"
:is-followed="author.followedByCurrentUser"
@update="voted = true"
/>
</ds-flex-item>

View File

@ -1,6 +1,6 @@
<template>
<ds-button
:disabled="disabled || !followId"
:disabled="disabled || !followId || isFollowed"
:loading="loading"
icon="plus"
primary
@ -18,7 +18,8 @@ export default {
name: 'HcFollowButton',
props: {
followId: { type: String, default: null }
followId: { type: String, default: null },
isFollowed: { type: Boolean, default: false }
},
data() {
return {

View File

@ -4,7 +4,7 @@
style="text-align: center"
>
<ds-button
:disabled="disabled || loading"
:disabled="disabled || loading || isShouted"
danger
size="x-large"
icon="bullhorn"
@ -28,7 +28,8 @@ import gql from 'graphql-tag'
export default {
props: {
count: { type: Number, default: 0 },
postId: { type: String, default: null }
postId: { type: String, default: null },
isShouted: { type: Boolean, default: false }
},
data() {
return {

View File

@ -29,6 +29,7 @@ export default app => {
slug
avatar
followedByCount
followedByCurrentUser
contributionsCount
commentsCount
badges {
@ -41,12 +42,14 @@ export default app => {
}
}
followedByCount
followedByCurrentUser
followedBy(first: 7) {
id
name
slug
avatar
followedByCount
followedByCurrentUser
contributionsCount
commentsCount
badges {

View File

@ -108,6 +108,7 @@ export default {
shoutedCount
commentsCount
followedByCount
followedByCurrentUser
location {
name: name${this.$i18n.locale().toUpperCase()}
}

View File

@ -29,6 +29,7 @@
<hc-shout-button
v-if="post.author"
:count="post.shoutedCount"
:is-shouted="post.shoutedByCurrentUser"
:post-id="post.id"
/>
<!-- Categories -->
@ -188,6 +189,7 @@ export default {
contributionsCount
commentsCount
followedByCount
followedByCurrentUser
location {
name: name${this.$i18n.locale().toUpperCase()}
}
@ -215,6 +217,7 @@ export default {
contributionsCount
commentsCount
followedByCount
followedByCurrentUser
location {
name: name${this.$i18n.locale().toUpperCase()}
}
@ -231,6 +234,7 @@ export default {
icon
}
shoutedCount
shoutedByCurrentUser
}
}
`)

View File

@ -109,6 +109,7 @@ export default {
avatar
contributionsCount
followedByCount
followedByCurrentUser
commentsCount
location {
name: name${this.$i18n.locale().toUpperCase()}

View File

@ -86,6 +86,7 @@
<hc-follow-button
v-if="!myProfile"
:follow-id="user.id"
:is-followed="user.followedByCurrentUser"
@update="voted = true && fetchUser()"
/>
</ds-space>