From 7c2982064e6faf60c95e909e7722d6110310055a Mon Sep 17 00:00:00 2001 From: taehoon Date: Mon, 22 Jul 2019 16:58:20 -0400 Subject: enlarge avatar in profile page --- src/components/user_card/user_card.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/components/user_card/user_card.js') diff --git a/src/components/user_card/user_card.js b/src/components/user_card/user_card.js index e019ebbd..a3c962fb 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) } } } -- cgit v1.2.3-70-g09d2 From 5881d92eb7ce143757ccca7b0e91abd7d0b9c69f Mon Sep 17 00:00:00 2001 From: taehoon Date: Tue, 23 Jul 2019 15:04:28 -0400 Subject: use $route instead of $router.currentRoute --- src/components/user_card/user_card.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/components/user_card/user_card.js') diff --git a/src/components/user_card/user_card.js b/src/components/user_card/user_card.js index a3c962fb..070af38a 100644 --- a/src/components/user_card/user_card.js +++ b/src/components/user_card/user_card.js @@ -104,8 +104,7 @@ export default { }, isActiveRoute () { const profileRoute = this.userProfileLink(this.user) - const currentRoute = this.$router.currentRoute - return profileRoute.name === currentRoute.name && isEqual(profileRoute.params, currentRoute.params) + return profileRoute.name === this.$route.name && isEqual(profileRoute.params, this.$route.params) } }, components: { -- cgit v1.2.3-70-g09d2 From b2bd128f059de44a0ec27591dbc0052f494887a1 Mon Sep 17 00:00:00 2001 From: taehoon 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.js') 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 @@