diff options
| author | Roger Braun <roger@rogerbraun.net> | 2016-12-08 09:09:21 +0100 |
|---|---|---|
| committer | Roger Braun <roger@rogerbraun.net> | 2016-12-08 09:09:21 +0100 |
| commit | fc268c48bc95ee8947da071305a436b293f44c02 (patch) | |
| tree | d5753fba620f24151fd1895aba194184d6cf16e4 /src/components/user_card_content/user_card_content.vue | |
| parent | f18f87747f72e8ee45ea0eebe5fd2878e116e02e (diff) | |
Very basic user following.
Diffstat (limited to 'src/components/user_card_content/user_card_content.vue')
| -rw-r--r-- | src/components/user_card_content/user_card_content.vue | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/components/user_card_content/user_card_content.vue b/src/components/user_card_content/user_card_content.vue index 7ad86e63..484597ab 100644 --- a/src/components/user_card_content/user_card_content.vue +++ b/src/components/user_card_content/user_card_content.vue @@ -6,6 +6,21 @@ <span class="glyphicon glyphicon-user"></span> <div class='user-name'>{{user.name}}</div> <div class='user-screen-name'>@{{user.screen_name}}</div> + <div v-if="isOtherUser" class="following-info"> + <div v-if="user.follows_you" class="following"> + Follows you! + </div> + <div class="followed"> + <span v-if="user.following"> + Following them! + </span> + <span v-if="!user.following" > + <button @click="followUser"> + Follow! + </button> + </span> + </div> + </div> </div> </div> <div class="panel-body"> @@ -37,6 +52,15 @@ color: `#${this.user.profile_link_color}`, 'background-image': `url(${this.user.cover_photo})` } + }, + isOtherUser () { + return this.user !== this.$store.state.users.currentUser + } + }, + methods: { + followUser () { + this.$store.state.api.backendInteractor.followUser(this.user.id) + .then((x) => console.log) } } } |
