1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
|
/*
* SPDX-FileCopyrightText: syuilo and misskey-project
* SPDX-License-Identifier: AGPL-3.0-only
*/
import { computed, defineAsyncComponent, reactive } from 'vue';
import { clearCache } from './scripts/clear-cache.js';
import { instance } from './instance.js';
import { $i } from '@/account.js';
import { miLocalStorage } from '@/local-storage.js';
import { openInstanceMenu } from '@/ui/_common_/common.js';
import { lookup } from '@/scripts/lookup.js';
import * as os from '@/os.js';
import { i18n } from '@/i18n.js';
import { ui } from '@@/js/config.js';
import { unisonReload } from '@/scripts/unison-reload.js';
export const navbarItemDef = reactive({
notifications: {
title: i18n.ts.notifications,
icon: 'ti ti-bell',
show: computed(() => $i != null),
indicated: computed(() => $i != null && $i.hasUnreadNotification),
indicateValue: computed(() => {
if (!$i || $i.unreadNotificationsCount === 0) return '';
if ($i.unreadNotificationsCount > 99) {
return '99+';
} else {
return $i.unreadNotificationsCount.toString();
}
}),
to: '/my/notifications',
},
drive: {
title: i18n.ts.drive,
icon: 'ti ti-cloud',
show: computed(() => $i != null),
to: '/my/drive',
},
followRequests: {
title: i18n.ts.followRequests,
icon: 'ti ti-user-plus',
show: computed(() => $i != null && ($i.isLocked || $i.hasPendingReceivedFollowRequest || $i.hasPendingSentFollowRequest)),
indicated: computed(() => $i != null && $i.hasPendingReceivedFollowRequest),
to: '/my/follow-requests',
},
explore: {
title: i18n.ts.explore,
icon: 'ti ti-hash',
to: '/explore',
},
announcements: {
title: i18n.ts.announcements,
icon: 'ti ti-speakerphone',
indicated: computed(() => $i != null && $i.hasUnreadAnnouncement),
to: '/announcements',
},
search: {
title: i18n.ts.search,
icon: 'ti ti-search',
to: '/search',
},
lookup: {
title: i18n.ts.lookup,
icon: 'ti ti-world-search',
action: (ev) => {
lookup();
},
},
following: {
title: i18n.ts.following,
icon: 'ph-user-check ph-bold ph-lg',
show: computed(() => $i != null && !$i.movedTo),
to: '/following-feed',
},
scheduledNotes: {
title: i18n.ts.scheduledNotes,
icon: 'ti ti-calendar-event',
show: computed(() => $i != null),
action: (ev) => {
const { dispose } = os.popup(defineAsyncComponent(() => import('@/components/MkSchedulePostListDialog.vue')), {}, {
closed: () => {
dispose();
},
});
},
},
lists: {
title: i18n.ts.lists,
icon: 'ti ti-list',
show: computed(() => $i != null),
to: '/my/lists',
},
antennas: {
title: i18n.ts.antennas,
icon: 'ti ti-antenna',
show: computed(() => $i != null),
to: '/my/antennas',
},
favorites: {
title: i18n.ts.favorites,
icon: 'ti ti-star',
show: computed(() => $i != null),
to: '/my/favorites',
},
pages: {
title: i18n.ts.pages,
icon: 'ti ti-news',
to: '/pages',
},
play: {
title: 'Play',
icon: 'ti ti-player-play',
to: '/play',
},
gallery: {
title: i18n.ts.gallery,
icon: 'ph-images ph-bold ph-lg',
to: '/gallery',
},
clips: {
title: i18n.ts.clip,
icon: 'ti ti-paperclip',
show: computed(() => $i != null),
to: '/my/clips',
},
channels: {
title: i18n.ts.channel,
icon: 'ti ti-device-tv',
to: '/channels',
},
achievements: {
title: i18n.ts.achievements,
icon: 'ti ti-medal',
show: computed(() => $i != null && instance.enableAchievements),
to: '/my/achievements',
},
games: {
title: 'Games',
icon: 'ti ti-device-gamepad',
to: '/games',
},
ui: {
title: i18n.ts.switchUi,
icon: 'ti ti-devices',
action: (ev: MouseEvent) => {
os.popupMenu([{
text: i18n.ts.default,
active: ui === 'default' || ui === null,
action: () => {
miLocalStorage.setItem('ui', 'default');
unisonReload();
},
}, {
text: i18n.ts.deck,
active: ui === 'deck',
action: () => {
miLocalStorage.setItem('ui', 'deck');
unisonReload();
},
}, {
text: i18n.ts.classic,
active: ui === 'classic',
action: () => {
miLocalStorage.setItem('ui', 'classic');
unisonReload();
},
}], ev.currentTarget ?? ev.target);
},
},
about: {
title: i18n.ts.about,
icon: 'ti ti-info-circle',
action: (ev) => {
openInstanceMenu(ev);
},
},
reload: {
title: i18n.ts.reload,
icon: 'ti ti-refresh',
action: (ev) => {
location.reload();
},
},
profile: {
title: i18n.ts.profile,
icon: 'ti ti-user',
show: computed(() => $i != null),
to: `/@${$i?.username}`,
},
cacheClear: {
title: i18n.ts.clearCache,
icon: 'ti ti-trash',
action: (ev) => {
clearCache();
},
},
});
|