feat: Make mobile account avatar clickable

This commit is contained in:
ThatOneCalculator 2022-08-16 00:22:37 -07:00
parent d5ab9d05bc
commit 0115747997
3 changed files with 11 additions and 8 deletions

View File

@ -1,6 +1,6 @@
{
"name": "misskey",
"version": "12.118.1-calc.10",
"version": "12.118.1-calc.11",
"codename": "aqua",
"repository": {
"type": "git",

View File

@ -1,7 +1,9 @@
<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">
<MkAvatar v-if="props.displayMyAvatar && $i" class="avatar" :user="$i" :disable-preview="true"/>
<button v-click-anime v-tooltip.noDelay.right="`${i18n.ts.account}: @${$i.username}`" class="item _button account" @click="openAccountMenu">
<MkAvatar v-if="props.displayMyAvatar && $i" class="avatar" :user="$i" :disable-preview="true"/>
</button>
</div>
<template v-if="metadata">
<div v-if="!hideTitle" class="titleContainer" @click="showTabsPopup">
@ -44,7 +46,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 +89,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;

View File

@ -325,11 +325,6 @@ const wallpaper = localStorage.getItem('wallpaper') != null;
margin-right: 8px;
}
}
/* &:hover {
background: var(--X2);
} */
> .indicator {
position: absolute;
top: 0;