From 7c2982064e6faf60c95e909e7722d6110310055a Mon Sep 17 00:00:00 2001
From: taehoon <th.dev91@gmail.com>
Date: Mon, 22 Jul 2019 16:58:20 -0400
Subject: enlarge avatar in profile page

---
 src/components/user_card/user_card.vue | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

(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 9e142480..3c0bf0d4 100644
--- a/src/components/user_card/user_card.vue
+++ b/src/components/user_card/user_card.vue
@@ -7,7 +7,20 @@
     <div class="panel-heading">
       <div class="user-info">
         <div class="container">
-          <router-link :to="userProfileLink(user)">
+          <a
+            v-if="isActiveRoute"
+            class="user-info-avatar-link"
+            @click="enlargeAvatar"
+          >
+            <UserAvatar
+              :better-shadow="betterShadow"
+              :user="user"
+            />
+          </a>
+          <router-link
+            v-else
+            :to="userProfileLink(user)"
+          >
             <UserAvatar
               :better-shadow="betterShadow"
               :user="user"
@@ -372,6 +385,10 @@
     }
   }
 
+  &-avatar-link {
+    cursor: pointer;
+  }
+
   .usersettings {
     color: $fallback--lightText;
     color: var(--lightText, $fallback--lightText);
-- 
cgit v1.2.3-70-g09d2


From b2bd128f059de44a0ec27591dbc0052f494887a1 Mon Sep 17 00:00:00 2001
From: taehoon <th.dev91@gmail.com>
Date: Thu, 25 Jul 2019 15:14:44 -0400
Subject: allow zooming avatar in profile panel header

---
 src/components/user_card/user_card.js        | 9 ++-------
 src/components/user_card/user_card.vue       | 4 ++--
 src/components/user_profile/user_profile.vue | 1 +
 3 files changed, 5 insertions(+), 9 deletions(-)

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

diff --git a/src/components/user_card/user_card.js b/src/components/user_card/user_card.js
index 070af38a..82d3b835 100644
--- a/src/components/user_card/user_card.js
+++ b/src/components/user_card/user_card.js
@@ -5,10 +5,9 @@ import ModerationTools from '../moderation_tools/moderation_tools.vue'
 import { hex2rgb } from '../../services/color_convert/color_convert.js'
 import { requestFollow, requestUnfollow } from '../../services/follow_manipulate/follow_manipulate'
 import generateProfileLink from 'src/services/user_profile_link_generator/user_profile_link_generator'
-import { isEqual } from 'lodash'
 
 export default {
-  props: [ 'user', 'switcher', 'selected', 'hideBio', 'rounded', 'bordered' ],
+  props: [ 'user', 'switcher', 'selected', 'hideBio', 'rounded', 'bordered', 'allowZoomingAvatar' ],
   data () {
     return {
       followRequestInProgress: false,
@@ -101,10 +100,6 @@ export default {
       const validRole = rights.admin || rights.moderator
       const roleTitle = rights.admin ? 'admin' : 'moderator'
       return validRole && roleTitle
-    },
-    isActiveRoute () {
-      const profileRoute = this.userProfileLink(this.user)
-      return profileRoute.name === this.$route.name && isEqual(profileRoute.params, this.$route.params)
     }
   },
   components: {
@@ -168,7 +163,7 @@ export default {
     reportUser () {
       this.$store.dispatch('openUserReportingModal', this.user.id)
     },
-    enlargeAvatar () {
+    zoomAvatar () {
       const attachment = {
         url: this.user.profile_image_url_original,
         mimetype: 'image'
diff --git a/src/components/user_card/user_card.vue b/src/components/user_card/user_card.vue
index 3c0bf0d4..3c200a7f 100644
--- a/src/components/user_card/user_card.vue
+++ b/src/components/user_card/user_card.vue
@@ -8,9 +8,9 @@
       <div class="user-info">
         <div class="container">
           <a
-            v-if="isActiveRoute"
+            v-if="allowZoomingAvatar"
             class="user-info-avatar-link"
-            @click="enlargeAvatar"
+            @click="zoomAvatar"
           >
             <UserAvatar
               :better-shadow="betterShadow"
diff --git a/src/components/user_profile/user_profile.vue b/src/components/user_profile/user_profile.vue
index e862440e..cffa28f1 100644
--- a/src/components/user_profile/user_profile.vue
+++ b/src/components/user_profile/user_profile.vue
@@ -8,6 +8,7 @@
         :user="user"
         :switcher="true"
         :selected="timeline.viewing"
+        :allow-zooming-avatar="true"
         rounded="top"
       />
       <tab-switcher
-- 
cgit v1.2.3-70-g09d2


From be7a508d89d8ea4b78abeba73625d25d22726270 Mon Sep 17 00:00:00 2001
From: taehoon <th.dev91@gmail.com>
Date: Thu, 25 Jul 2019 15:49:02 -0400
Subject: add zoom-in indication to avatar

---
 src/components/user_card/user_card.vue | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

(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 3c200a7f..fc18e240 100644
--- a/src/components/user_card/user_card.vue
+++ b/src/components/user_card/user_card.vue
@@ -16,6 +16,9 @@
               :better-shadow="betterShadow"
               :user="user"
             />
+            <div class="user-info-avatar-link-overlay">
+              <i class="button-icon icon-zoom-in" />
+            </div>
           </a>
           <router-link
             v-else
@@ -364,6 +367,7 @@
   .container {
     padding: 16px 0 6px;
     display: flex;
+    align-items: flex-start;
     max-height: 56px;
 
     .avatar {
@@ -386,7 +390,32 @@
   }
 
   &-avatar-link {
+    position: relative;
     cursor: pointer;
+
+    &-overlay {
+      position: absolute;
+      left: 0;
+      top: 0;
+      right: 0;
+      bottom: 0;
+      background-color: rgba(0, 0, 0, 0.3);
+      display: flex;
+      justify-content: center;
+      align-items: center;
+      border-radius: $fallback--avatarRadius;
+      border-radius: var(--avatarRadius, $fallback--avatarRadius);
+      opacity: 0;
+      transition: opacity .2s ease;
+
+      i {
+        color: #FFF;
+      }
+    }
+
+    &:hover &-overlay {
+      opacity: 1;
+    }
   }
 
   .usersettings {
-- 
cgit v1.2.3-70-g09d2

