refactor(client): Refactor MkPageHeader #9869 (#9878)

* disable animation

* refactor(client): MkPageHeaderのタブをMkPageHeader.tabsに分離
animationをフォローするように

* update CHANGELOG.md

* remove unnecessary props
This commit is contained in:
tamaina 2023-02-11 16:04:45 +09:00 committed by GitHub
parent f74d9c7ed0
commit 9349f72227
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 239 additions and 193 deletions

View file

@ -32,6 +32,7 @@ import { i18n } from '@/i18n';
import { instance } from '@/instance';
import { $i } from '@/account';
import { definePageMetadata } from '@/scripts/page-metadata';
import type { Tab } from '@/components/global/MkPageHeader.tabs.vue';
provide('shouldOmitHeaderTitle', true);
@ -57,7 +58,7 @@ function queueUpdated(q: number): void {
}
function top(): void {
scroll(rootEl, { top: 0 });
if (rootEl) scroll(rootEl, { top: 0 });
}
async function chooseList(ev: MouseEvent): Promise<void> {
@ -150,7 +151,7 @@ const headerTabs = $computed(() => [{
title: i18n.ts.channel,
iconOnly: true,
onClick: chooseChannel,
}]);
}] as Tab[]);
const headerTabsWhenNotLogin = $computed(() => [
...(isLocalTimelineAvailable ? [{
@ -165,7 +166,7 @@ const headerTabsWhenNotLogin = $computed(() => [
icon: 'ti ti-whirl',
iconOnly: true,
}] : []),
]);
] as Tab[]);
definePageMetadata(computed(() => ({
title: i18n.ts.timeline,