feat: Tapping avatar in mobile opens account modal

This commit is contained in:
Kainoa Kanter 2022-08-16 00:32:21 -07:00 committed by GitHub
parent dddc076d01
commit e3290eb586
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,6 +1,6 @@
<template>
<div v-if="show" ref="el" class="fdidabkb" :class="{ slim: narrow, thin: thin_ }" :style="{ background: bg }" @click="onClick">
<div v-if="narrow" class="buttons left">
<div v-if="narrow" class="buttons left" @click="openAccountMenu">
<MkAvatar v-if="props.displayMyAvatar && $i" class="avatar" :user="$i" :disable-preview="true"/>
</div>
<template v-if="metadata">
@ -44,7 +44,7 @@ import { scrollToTop } from '@/scripts/scroll';
import { i18n } from '@/i18n';
import { globalEvents } from '@/events';
import { injectPageMetadata } from '@/scripts/page-metadata';
import { $i } from '@/account';
import { $i, openAccountMenu as openAccountMenu_ } from '@/account';
type Tab = {
key?: string | null;
@ -87,6 +87,12 @@ const show = $computed(() => {
return !hideTitle || hasTabs || hasActions;
});
const openAccountMenu = (ev: MouseEvent) => {
openAccountMenu_({
withExtraOperation: true,
}, ev);
};
const showTabsPopup = (ev: MouseEvent) => {
if (!hasTabs) return;
if (!narrow) return;