From fc268c48bc95ee8947da071305a436b293f44c02 Mon Sep 17 00:00:00 2001
From: Roger Braun <roger@rogerbraun.net>
Date: Thu, 8 Dec 2016 09:09:21 +0100
Subject: Very basic user following.

---
 .../user_card_content/user_card_content.vue        | 24 ++++++++++++++++++++++
 1 file changed, 24 insertions(+)

(limited to 'src/components/user_card_content/user_card_content.vue')

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)
       }
     }
   }
-- 
cgit v1.2.3-70-g09d2

