From 7c2982064e6faf60c95e909e7722d6110310055a Mon Sep 17 00:00:00 2001 From: taehoon Date: Mon, 22 Jul 2019 16:58:20 -0400 Subject: [PATCH] enlarge avatar in profile page --- src/components/user_card/user_card.js | 14 ++++++++++++++ src/components/user_card/user_card.vue | 19 ++++++++++++++++++- 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/src/components/user_card/user_card.js b/src/components/user_card/user_card.js index e019ebbdbf..a3c962fb88 100644 --- a/src/components/user_card/user_card.js +++ b/src/components/user_card/user_card.js @@ -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) } } } diff --git a/src/components/user_card/user_card.vue b/src/components/user_card/user_card.vue index 9e14248010..3c0bf0d4ea 100644 --- a/src/components/user_card/user_card.vue +++ b/src/components/user_card/user_card.vue @@ -7,7 +7,20 @@