From e801d78e9d923df1263eb9dc78db8fdfa8637734 Mon Sep 17 00:00:00 2001
From: shpuld <shp@cock.li>
Date: Sun, 17 Feb 2019 18:54:22 +0200
Subject: Take over branch and fix some issues

---
 src/components/user_card/user_card.vue | 129 +++++++++++++++++++--------------
 1 file changed, 73 insertions(+), 56 deletions(-)

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

diff --git a/src/components/user_card/user_card.vue b/src/components/user_card/user_card.vue
index 1fab2323..ce4edb3c 100644
--- a/src/components/user_card/user_card.vue
+++ b/src/components/user_card/user_card.vue
@@ -3,53 +3,55 @@
     <router-link :to="userProfileLink(user)">
       <UserAvatar class="avatar" @click.prevent.native="toggleUserExpanded" :src="user.profile_image_url"/>
     </router-link>
-    <div class="usercard" v-if="userExpanded">
-      <user-card-content :user="user" :switcher="false"></user-card-content>
-    </div>
-    <div class="name-and-screen-name" v-else>
-      <div :title="user.name" class="user-name">
-        <span v-if="user.name_html" v-html="user.name_html"></span>
-        <span v-else>{{ user.name }}</span>
+    <div class="user-card-main-content">
+      <div class="usercard" v-if="userExpanded">
+        <user-card-content :user="user" :switcher="false"></user-card-content>
       </div>
-      <div class="user-link-action">
-        <router-link class='user-screen-name' :to="userProfileLink(user)">
-          @{{user.screen_name}}
-        </router-link>
+      <div class="name-and-screen-name" v-if="!userExpanded">
+        <div :title="user.name" class="user-name">
+          <span v-if="user.name_html" v-html="user.name_html"></span>
+          <span v-else>{{ user.name }}</span>
+        </div>
+        <div class="user-link-action">
+          <router-link class='user-screen-name' :to="userProfileLink(user)">
+            @{{user.screen_name}}
+          </router-link>
+        </div>
+      </div>
+      <div class="follow-box" v-if="!userExpanded">
+        <span class="faint" v-if="!noFollowsYou && user.follows_you">
+          {{ currentUser.id == user.id ? $t('user_card.its_you') : $t('user_card.follows_you') }}
+        </span>
+        <button
+          v-if="showFollow"
+          class="btn btn-default"
+          @click="followUser"
+          :disabled="followRequestInProgress"
+          :title="followRequestSent ? $t('user_card.follow_again') : ''"
+        >
+          <template v-if="followRequestInProgress">
+            {{ $t('user_card.follow_progress') }}
+          </template>
+          <template v-else-if="followRequestSent">
+            {{ $t('user_card.follow_sent') }}
+          </template>
+          <template v-else>
+            {{ $t('user_card.follow') }}
+          </template>
+        </button>
+        <button v-if="following" class="btn btn-default pressed" @click="unfollowUser" :disabled="followRequestInProgress">
+          <template v-if="followRequestInProgress">
+            {{ $t('user_card.follow_progress') }}
+          </template>
+          <template v-else>
+            {{ $t('user_card.follow_unfollow') }}
+          </template>
+        </button>
+      </div>
+      <div class="approval" v-if="showApproval">
+        <button class="btn btn-default" @click="approveUser">{{ $t('user_card.approve') }}</button>
+        <button class="btn btn-default" @click="denyUser">{{ $t('user_card.deny') }}</button>
       </div>
-    </div>
-    <div class="follow-box">
-      <span class="faint" v-if="showFollows && user.follows_you">
-        {{ currentUser.id == user.id ? $t('user_card.its_you') : $t('user_card.follows_you') }}
-      </span>
-      <button
-        v-if="showFollow"
-        class="btn btn-default"
-        @click="followUser"
-        :disabled="followRequestInProgress"
-        :title="followRequestSent ? $t('user_card.follow_again') : ''"
-      >
-        <template v-if="followRequestInProgress">
-          {{ $t('user_card.follow_progress') }}
-        </template>
-        <template v-else-if="followRequestSent">
-          {{ $t('user_card.follow_sent') }}
-        </template>
-        <template v-else>
-          {{ $t('user_card.follow') }}
-        </template>
-      </button>
-      <button v-if="showActions && following" class="btn btn-default" @click="unfollowUser" :disabled="followRequestInProgress">
-        <template v-if="followRequestInProgress">
-          {{ $t('user_card.follow_progress') }}
-        </template>
-        <template v-else>
-          {{ $t('user_card.follow_unfollow') }}
-        </template>
-      </button>
-    </div>
-    <div class="approval" v-if="showApproval">
-      <button class="btn btn-default" @click="approveUser">{{ $t('user_card.approve') }}</button>
-      <button class="btn btn-default" @click="denyUser">{{ $t('user_card.deny') }}</button>
     </div>
   </div>
 </template>
@@ -58,9 +60,16 @@
 
 <style lang="scss">
 @import '../../_variables.scss';
-.name-and-screen-name {
+
+.user-card-main-content {
+  display: flex;
+  flex-direction: column;
+  flex: 1 1 100%;
   margin-left: 0.7em;
-  margin-top: 0.0em;
+  min-width: 0;
+}
+
+.name-and-screen-name {
   text-align: left;
   width: 100%;
 
@@ -98,22 +107,24 @@
   }
 
   .follow-box {
-    width: 15em;
     text-align: center;
-    position: relative;
+    flex-shrink: 0;
+    display: flex;
+    flex-direction: row;
+    justify-content: space-between;
+    flex-wrap: wrap;
+    line-height: 1.5em;
 
     .btn {
-      position: absolute;
-      bottom: 0;
-      left: 0;
-      width: 100%;
+      margin-top: 0.5em;
+      margin-left: auto;
+      width: 10em;
     }
   }
 }
 
 .usercard {
   width: fill-available;
-  margin: 0.2em 0 0 0.7em;
   border-radius: $fallback--panelRadius;
   border-radius: var(--panelRadius, $fallback--panelRadius);
   border-style: solid;
@@ -134,9 +145,15 @@
 }
 
 .approval {
+  display: flex;
+  flex-direction: row;
+  flex-wrap: wrap;
   button {
-    width: 100%;
-    margin-bottom: 0.5em;
+    margin-top: 0.5em;
+    margin-right: 0.5em;
+    flex: 1 1;
+    max-width: 12em;
+    min-width: 8em;
   }
 }
 </style>
-- 
cgit v1.2.3-70-g09d2

