logo

pleroma-fe

My custom branche(s) on git.pleroma.social/pleroma/pleroma-fe git clone https://hacktivis.me/git/pleroma-fe.git
commit: 91422367d35372bd5977a5c091c80647e2628f6e
parent 88a3cf8705f925c31b5fad67d0fb709a51447156
Author: HJ <30-hj@users.noreply.git.pleroma.social>
Date:   Mon, 22 Aug 2022 22:34:38 +0000

Merge branch 'allow-opening-profile-in-user-popover' into 'develop'

Allow opening profile in user popover when clicking on avatar

See merge request pleroma/pleroma-fe!1586

Diffstat:

Msrc/components/settings_modal/tabs/general_tab.js5+++++
Msrc/components/settings_modal/tabs/general_tab.vue10++++++----
Msrc/components/user_popover/user_popover.js4++--
Msrc/components/user_popover/user_popover.vue2+-
Msrc/i18n/en.json5++++-
Msrc/modules/config.js5+++--
6 files changed, 21 insertions(+), 10 deletions(-)

diff --git a/src/components/settings_modal/tabs/general_tab.js b/src/components/settings_modal/tabs/general_tab.js @@ -44,6 +44,11 @@ const GeneralTab = { value: mode, label: this.$t(`settings.third_column_mode_${mode}`) })), + userPopoverAvatarActionOptions: ['close', 'zoom', 'open'].map(mode => ({ + key: mode, + value: mode, + label: this.$t(`settings.user_popover_avatar_action_${mode}`) + })), loopSilentAvailable: // Firefox Object.getOwnPropertyDescriptor(HTMLVideoElement.prototype, 'mozHasAudio') || diff --git a/src/components/settings_modal/tabs/general_tab.vue b/src/components/settings_modal/tabs/general_tab.vue @@ -60,12 +60,14 @@ </BooleanSetting> </li> <li> - <BooleanSetting - path="userPopoverZoom" + <ChoiceSetting + id="userPopoverAvatarAction" + path="userPopoverAvatarAction" + :options="userPopoverAvatarActionOptions" expert="1" > - {{ $t('settings.user_popover_avatar_zoom') }} - </BooleanSetting> + {{ $t('settings.user_popover_avatar_action') }} + </ChoiceSetting> </li> <li> <BooleanSetting diff --git a/src/components/user_popover/user_popover.js b/src/components/user_popover/user_popover.js @@ -11,8 +11,8 @@ const UserPopover = { Popover: defineAsyncComponent(() => import('../popover/popover.vue')) }, computed: { - userPopoverZoom () { - return this.$store.getters.mergedConfig.userPopoverZoom + userPopoverAvatarAction () { + return this.$store.getters.mergedConfig.userPopoverAvatarAction }, userPopoverOverlay () { return this.$store.getters.mergedConfig.userPopoverOverlay diff --git a/src/components/user_popover/user_popover.vue b/src/components/user_popover/user_popover.vue @@ -14,7 +14,7 @@ class="user-popover" :user-id="userId" :hide-bio="true" - :avatar-action="userPopoverZoom ? 'zoom' : close" + :avatar-action="userPopoverAvatarAction == 'close' ? close : userPopoverAvatarAction" :on-close="close" /> </template> diff --git a/src/i18n/en.json b/src/i18n/en.json @@ -579,7 +579,10 @@ "mention_link_show_avatar_quick": "Show user avatar next to mentions", "mention_link_fade_domain": "Fade domains (e.g. {'@'}example.org in {'@'}foo{'@'}example.org)", "mention_link_bolden_you": "Highlight mention of you when you are mentioned", - "user_popover_avatar_zoom": "Clicking on user avatar in popover zooms it instead of closing the popover", + "user_popover_avatar_action": "Popover avatar click action", + "user_popover_avatar_action_zoom": "Zoom the avatar", + "user_popover_avatar_action_close": "Close the popover", + "user_popover_avatar_action_open": "Open profile", "user_popover_avatar_overlay": "Show user popover over user avatar", "fun": "Fun", "greentext": "Meme arrows", diff --git a/src/modules/config.js b/src/modules/config.js @@ -17,7 +17,8 @@ export const multiChoiceProperties = [ 'subjectLineBehavior', 'conversationDisplay', // tree | linear 'conversationOtherRepliesButton', // below | inside - 'mentionLinkDisplay' // short | full_for_remote | full + 'mentionLinkDisplay', // short | full_for_remote | full + 'userPopoverAvatarAction' // close | zoom | open ] export const defaultState = { @@ -82,7 +83,7 @@ export const defaultState = { useContainFit: true, disableStickyHeaders: false, showScrollbars: false, - userPopoverZoom: false, + userPopoverAvatarAction: 'close', userPopoverOverlay: true, sidebarColumnWidth: '25rem', contentColumnWidth: '45rem',