This commit is contained in:
mattyatea 2024-01-24 01:14:06 +09:00
parent 7dd7c6ad4a
commit 6286e94f66
5 changed files with 30 additions and 31 deletions

View file

@ -5,7 +5,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<template>
<MkStickyContainer>
<template #header><MkPageHeader v-model:tab="tab" :actions="headerActions" :tabs="headerTabs"/></template>
<template #header><MkPageHeader v-model:tab="tab" :tabs="headerTabs" hide="true" :actions="headerActions"/></template>
<MkSpacer :contentMax="800">
<MkHorizontalSwipe v-model:tab="tab" :tabs="headerTabs">
<div v-if="tab === 'all'" key="all">
@ -31,6 +31,7 @@ import * as os from '@/os.js';
import { i18n } from '@/i18n.js';
import { definePageMetadata } from '@/scripts/page-metadata.js';
import { notificationTypes } from '@/const.js';
import { misskeyApi } from '@/scripts/misskey-api.js';
const tab = ref('all');
const includeTypes = ref<string[] | null>(null);
@ -67,19 +68,13 @@ function setFilter(ev) {
os.popupMenu(items, ev.currentTarget ?? ev.target);
}
const headerActions = computed(() => [tab.value === 'all' ? {
const headerActions = computed(() => [{
text: i18n.ts.filter,
icon: 'ti ti-filter',
highlighted: includeTypes.value != null,
handler: setFilter,
} : undefined, tab.value === 'all' ? {
text: i18n.ts.markAllAsRead,
icon: 'ti ti-check',
handler: () => {
os.apiWithDialog('notifications/mark-all-as-read');
},
} : undefined].filter(x => x !== undefined));
} ].filter(x => x !== undefined));
misskeyApi('notifications/mark-all-as-read');
const headerTabs = computed(() => [{
key: 'all',
title: i18n.ts.all,

View file

@ -253,10 +253,10 @@ const headerActions = computed(() => {
disabled: onlyFiles } : undefined, {
type: 'switch',
text: i18n.ts.withSensitive,
ref: withSensitive,
}, {
type: 'switch',
text: i18n.ts.fileAttachedOnly,
ref: withSensitive,
}, {
type: 'switch',
text: i18n.ts.fileAttachedOnly,
ref: onlyFiles,
disabled: src.value === 'local' || src.value === 'social' ? withReplies : false,
@ -280,27 +280,27 @@ const headerTabs = computed(() => [...(defaultStore.reactiveState.pinnedUserList
key: 'list:' + l.id,
title: l.name,
icon: 'ti ti-star',
iconOnly: true,
iconOnly: false,
}))), {
key: 'home',
title: i18n.ts._timelines.home,
icon: 'ti ti-home',
iconOnly: true,
iconOnly: false,
}, ...(isLocalTimelineAvailable ? [{
key: 'local',
title: i18n.ts._timelines.local,
icon: 'ti ti-planet',
iconOnly: true,
iconOnly: false,
}, ...(isShowMediaTimeline.value ? [{
key: 'media',
title: i18n.ts._timelines.media,
icon: 'ti ti-photo',
iconOnly: true,
iconOnly: false,
}] : []), {
key: 'social',
title: i18n.ts._timelines.social,
icon: 'ti ti-universe',
iconOnly: true,
iconOnly: false,
}] : []), ...(remoteLocalTimelineEnable1.value ? [{
key: 'custom-timeline-1',
title: defaultStore.state.remoteLocalTimelineName1,
@ -330,7 +330,7 @@ const headerTabs = computed(() => [...(defaultStore.reactiveState.pinnedUserList
key: 'global',
title: i18n.ts._timelines.global,
icon: 'ti ti-whirl',
iconOnly: true,
iconOnly: false,
}] : []), {
icon: 'ti ti-list',
title: i18n.ts.lists,