This commit is contained in:
萧瑟 2026-06-24 21:25:53 +09:00 committed by GitHub
commit be470c537b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -6,7 +6,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<template>
<div v-if="show" ref="el" :class="[$style.root]">
<div :class="[$style.upper, { [$style.slim]: narrow, [$style.thin]: thin_ }]">
<div v-if="!thin_ && narrow && props.displayMyAvatar && $i" class="_button" @click="openAccountMenu">
<div v-if="shouldDisplayMyAvatar" class="_button" @click="openAccountMenu">
<MkAvatar :class="$style.avatar" :user="$i"/>
</div>
<div v-else-if="!thin_ && narrow && !hideTitle" :class="$style.buttons"></div>
@ -64,6 +64,7 @@ import XTabs from './MkPageHeader.tabs.vue';
import { getAccountMenu } from '@/accounts.js';
import { $i } from '@/i.js';
import { DI } from '@/di.js';
import { deviceKind } from '@/utility/device-kind.js';
import * as os from '@/os.js';
const props = withDefaults(defineProps<PageHeaderProps>(), {
@ -80,6 +81,7 @@ const pageMetadata = computed(() => props.overridePageMetadata ?? injectedPageMe
const hideTitle = computed(() => inject('shouldOmitHeaderTitle', false) || props.hideTitle || (props.canOmitTitle && props.tabs.length > 0));
const thin_ = props.thin || inject('shouldHeaderThin', false);
const shouldDisplayMyAvatar = computed(() => !thin_ && props.displayMyAvatar && $i && (narrow.value || deviceKind === 'smartphone'));
const el = useTemplateRef('el');
const narrow = ref(false);