Commit 7c298206 authored by Tae Hoon's avatar Tae Hoon

enlarge avatar in profile page

parent 8aa3e7d5
......@@ -5,6 +5,7 @@ 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' ],
......@@ -100,6 +101,11 @@ export default {
const validRole = rights.admin || rights.moderator
const roleTitle = rights.admin ? 'admin' : 'moderator'
return validRole && roleTitle
},
isActiveRoute () {
const profileRoute = this.userProfileLink(this.user)
const currentRoute = this.$router.currentRoute
return profileRoute.name === currentRoute.name && isEqual(profileRoute.params, currentRoute.params)
}
},
components: {
......@@ -162,6 +168,14 @@ export default {
},
reportUser () {
this.$store.dispatch('openUserReportingModal', this.user.id)
},
enlargeAvatar () {
const attachment = {
url: this.user.profile_image_url_original,
mimetype: 'image'
}
this.$store.dispatch('setMedia', [attachment])
this.$store.dispatch('setCurrent', attachment)
}
}
}
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment