allow zooming avatar in profile panel header

This commit is contained in:
taehoon 2019-07-25 15:14:44 -04:00
parent 5881d92eb7
commit b2bd128f05
3 changed files with 5 additions and 9 deletions

View File

@ -5,10 +5,9 @@ import ModerationTools from '../moderation_tools/moderation_tools.vue'
import { hex2rgb } from '../../services/color_convert/color_convert.js' import { hex2rgb } from '../../services/color_convert/color_convert.js'
import { requestFollow, requestUnfollow } from '../../services/follow_manipulate/follow_manipulate' import { requestFollow, requestUnfollow } from '../../services/follow_manipulate/follow_manipulate'
import generateProfileLink from 'src/services/user_profile_link_generator/user_profile_link_generator' import generateProfileLink from 'src/services/user_profile_link_generator/user_profile_link_generator'
import { isEqual } from 'lodash'
export default { export default {
props: [ 'user', 'switcher', 'selected', 'hideBio', 'rounded', 'bordered' ], props: [ 'user', 'switcher', 'selected', 'hideBio', 'rounded', 'bordered', 'allowZoomingAvatar' ],
data () { data () {
return { return {
followRequestInProgress: false, followRequestInProgress: false,
@ -101,10 +100,6 @@ export default {
const validRole = rights.admin || rights.moderator const validRole = rights.admin || rights.moderator
const roleTitle = rights.admin ? 'admin' : 'moderator' const roleTitle = rights.admin ? 'admin' : 'moderator'
return validRole && roleTitle return validRole && roleTitle
},
isActiveRoute () {
const profileRoute = this.userProfileLink(this.user)
return profileRoute.name === this.$route.name && isEqual(profileRoute.params, this.$route.params)
} }
}, },
components: { components: {
@ -168,7 +163,7 @@ export default {
reportUser () { reportUser () {
this.$store.dispatch('openUserReportingModal', this.user.id) this.$store.dispatch('openUserReportingModal', this.user.id)
}, },
enlargeAvatar () { zoomAvatar () {
const attachment = { const attachment = {
url: this.user.profile_image_url_original, url: this.user.profile_image_url_original,
mimetype: 'image' mimetype: 'image'

View File

@ -8,9 +8,9 @@
<div class="user-info"> <div class="user-info">
<div class="container"> <div class="container">
<a <a
v-if="isActiveRoute" v-if="allowZoomingAvatar"
class="user-info-avatar-link" class="user-info-avatar-link"
@click="enlargeAvatar" @click="zoomAvatar"
> >
<UserAvatar <UserAvatar
:better-shadow="betterShadow" :better-shadow="betterShadow"

View File

@ -8,6 +8,7 @@
:user="user" :user="user"
:switcher="true" :switcher="true"
:selected="timeline.viewing" :selected="timeline.viewing"
:allow-zooming-avatar="true"
rounded="top" rounded="top"
/> />
<tab-switcher <tab-switcher