From 608d1e6776769b933e194f96b4892a888880f60f Mon Sep 17 00:00:00 2001
From: eal <eal@waifu.club>
Date: Tue, 7 Nov 2017 22:38:28 +0200
Subject: Add blocks.

---
 .../user_card_content/user_card_content.vue        | 22 ++++++++++++++++++++++
 1 file changed, 22 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 4895f36f..8aef7e8a 100644
--- a/src/components/user_card_content/user_card_content.vue
+++ b/src/components/user_card_content/user_card_content.vue
@@ -46,6 +46,18 @@
               </button>
             </span>
           </div>
+          <div class='block' v-if='isOtherUser'>
+            <span v-if='user.statusnet_blocking'>
+              <button @click="unblockUser" class="base04 base00-background pressed">
+                {{ $t('user_card.blocked') }}
+              </button>
+            </span>
+            <span v-if='!user.statusnet_blocking'>
+              <button @click="blockUser" class="base05 base02-background">
+                {{ $t('user_card.block') }}
+              </button>
+            </span>
+          </div>
         </div>
       </div>
     </div>
@@ -113,6 +125,16 @@
         store.state.api.backendInteractor.unfollowUser(this.user.id)
           .then((unfollowedUser) => store.commit('addNewUsers', [unfollowedUser]))
       },
+      blockUser () {
+        const store = this.$store
+        store.state.api.backendInteractor.blockUser(this.user.id)
+          .then((blockedUser) => store.commit('addNewUsers', [blockedUser]))
+      },
+      unblockUser () {
+        const store = this.$store
+        store.state.api.backendInteractor.unblockUser(this.user.id)
+          .then((unblockedUser) => store.commit('addNewUsers', [unblockedUser]))
+      },
       toggleMute () {
         const store = this.$store
         store.commit('setMuted', {user: this.user, muted: !this.user.muted})
-- 
cgit v1.2.3-70-g09d2

