2021-12-03 22:09:40 +09:00
|
|
|
import { computed, ref, reactive } from 'vue';
|
2022-06-20 17:38:49 +09:00
|
|
|
import { $i } from './account';
|
2021-11-12 02:02:25 +09:00
|
|
|
import { search } from '@/scripts/search';
|
|
|
|
import * as os from '@/os';
|
|
|
|
import { i18n } from '@/i18n';
|
|
|
|
import { ui } from '@/config';
|
|
|
|
import { unisonReload } from '@/scripts/unison-reload';
|
2020-10-17 20:12:00 +09:00
|
|
|
|
2022-07-14 17:42:12 +09:00
|
|
|
export const navbarItemDef = reactive({
|
2020-10-17 20:12:00 +09:00
|
|
|
notifications: {
|
|
|
|
title: 'notifications',
|
2022-12-19 13:54:35 +09:00
|
|
|
icon: 'fas fa-bell',
|
2020-12-19 10:55:52 +09:00
|
|
|
show: computed(() => $i != null),
|
|
|
|
indicated: computed(() => $i != null && $i.hasUnreadNotification),
|
2020-10-17 20:12:00 +09:00
|
|
|
to: '/my/notifications',
|
|
|
|
},
|
|
|
|
messaging: {
|
|
|
|
title: 'messaging',
|
2022-12-19 13:54:35 +09:00
|
|
|
icon: 'fas fa-comments',
|
2020-12-19 10:55:52 +09:00
|
|
|
show: computed(() => $i != null),
|
|
|
|
indicated: computed(() => $i != null && $i.hasUnreadMessagingMessage),
|
2020-11-03 10:43:50 +09:00
|
|
|
to: '/my/messaging',
|
2020-10-17 20:12:00 +09:00
|
|
|
},
|
|
|
|
drive: {
|
|
|
|
title: 'drive',
|
2022-12-19 13:54:35 +09:00
|
|
|
icon: 'fas fa-cloud',
|
2020-12-19 10:55:52 +09:00
|
|
|
show: computed(() => $i != null),
|
2020-10-17 20:12:00 +09:00
|
|
|
to: '/my/drive',
|
|
|
|
},
|
|
|
|
followRequests: {
|
|
|
|
title: 'followRequests',
|
2021-04-20 23:22:59 +09:00
|
|
|
icon: 'fas fa-user-clock',
|
2020-12-19 10:55:52 +09:00
|
|
|
show: computed(() => $i != null && $i.isLocked),
|
|
|
|
indicated: computed(() => $i != null && $i.hasPendingReceivedFollowRequest),
|
2020-10-17 20:12:00 +09:00
|
|
|
to: '/my/follow-requests',
|
|
|
|
},
|
|
|
|
explore: {
|
|
|
|
title: 'explore',
|
2022-12-19 13:54:35 +09:00
|
|
|
icon: 'fas fa-hashtag',
|
2020-10-17 20:12:00 +09:00
|
|
|
to: '/explore',
|
|
|
|
},
|
|
|
|
announcements: {
|
|
|
|
title: 'announcements',
|
2021-04-20 23:22:59 +09:00
|
|
|
icon: 'fas fa-broadcast-tower',
|
2020-12-19 10:55:52 +09:00
|
|
|
indicated: computed(() => $i != null && $i.hasUnreadAnnouncement),
|
2020-10-17 20:12:00 +09:00
|
|
|
to: '/announcements',
|
|
|
|
},
|
|
|
|
search: {
|
|
|
|
title: 'search',
|
2022-12-19 13:54:35 +09:00
|
|
|
icon: 'fas fa-search',
|
2020-10-17 20:12:00 +09:00
|
|
|
action: () => search(),
|
|
|
|
},
|
|
|
|
lists: {
|
|
|
|
title: 'lists',
|
2021-04-20 23:22:59 +09:00
|
|
|
icon: 'fas fa-list-ul',
|
2020-12-19 10:55:52 +09:00
|
|
|
show: computed(() => $i != null),
|
2022-07-07 17:28:13 +09:00
|
|
|
to: '/my/lists',
|
2020-10-17 20:12:00 +09:00
|
|
|
},
|
2022-06-30 10:53:40 +09:00
|
|
|
/*
|
2020-10-17 20:12:00 +09:00
|
|
|
groups: {
|
|
|
|
title: 'groups',
|
2021-04-20 23:22:59 +09:00
|
|
|
icon: 'fas fa-users',
|
2020-12-19 10:55:52 +09:00
|
|
|
show: computed(() => $i != null),
|
2020-10-17 20:12:00 +09:00
|
|
|
to: '/my/groups',
|
|
|
|
},
|
2022-06-30 10:53:40 +09:00
|
|
|
*/
|
2020-10-17 20:12:00 +09:00
|
|
|
antennas: {
|
|
|
|
title: 'antennas',
|
2021-04-20 23:22:59 +09:00
|
|
|
icon: 'fas fa-satellite',
|
2020-12-19 10:55:52 +09:00
|
|
|
show: computed(() => $i != null),
|
2022-07-07 17:28:13 +09:00
|
|
|
to: '/my/antennas',
|
2020-10-17 20:12:00 +09:00
|
|
|
},
|
|
|
|
favorites: {
|
|
|
|
title: 'favorites',
|
2022-12-19 13:54:35 +09:00
|
|
|
icon: 'fas fa-star',
|
2020-12-19 10:55:52 +09:00
|
|
|
show: computed(() => $i != null),
|
2020-10-17 20:12:00 +09:00
|
|
|
to: '/my/favorites',
|
|
|
|
},
|
|
|
|
pages: {
|
|
|
|
title: 'pages',
|
2021-04-20 23:22:59 +09:00
|
|
|
icon: 'fas fa-file-alt',
|
2020-11-17 14:59:15 +09:00
|
|
|
to: '/pages',
|
2020-10-17 20:12:00 +09:00
|
|
|
},
|
2021-04-24 22:38:24 +09:00
|
|
|
gallery: {
|
|
|
|
title: 'gallery',
|
|
|
|
icon: 'fas fa-icons',
|
|
|
|
to: '/gallery',
|
|
|
|
},
|
2020-11-15 12:04:54 +09:00
|
|
|
clips: {
|
|
|
|
title: 'clip',
|
2022-12-19 13:54:35 +09:00
|
|
|
icon: 'fas fa-paperclip',
|
2020-12-19 10:55:52 +09:00
|
|
|
show: computed(() => $i != null),
|
2020-11-15 12:04:54 +09:00
|
|
|
to: '/my/clips',
|
|
|
|
},
|
2020-10-17 20:12:00 +09:00
|
|
|
channels: {
|
|
|
|
title: 'channel',
|
2021-04-20 23:22:59 +09:00
|
|
|
icon: 'fas fa-satellite-dish',
|
2020-10-17 20:12:00 +09:00
|
|
|
to: '/channels',
|
|
|
|
},
|
2020-11-03 17:00:47 +09:00
|
|
|
ui: {
|
|
|
|
title: 'switchUi',
|
2021-04-20 23:22:59 +09:00
|
|
|
icon: 'fas fa-columns',
|
2020-11-03 17:00:47 +09:00
|
|
|
action: (ev) => {
|
2021-08-08 12:19:10 +09:00
|
|
|
os.popupMenu([{
|
2022-01-28 11:39:49 +09:00
|
|
|
text: i18n.ts.default,
|
2021-10-24 14:50:00 +09:00
|
|
|
active: ui === 'default' || ui === null,
|
2020-11-03 17:00:47 +09:00
|
|
|
action: () => {
|
|
|
|
localStorage.setItem('ui', 'default');
|
2021-02-17 21:36:56 +09:00
|
|
|
unisonReload();
|
2022-06-20 17:38:49 +09:00
|
|
|
},
|
2020-11-03 17:00:47 +09:00
|
|
|
}, {
|
2022-01-28 11:39:49 +09:00
|
|
|
text: i18n.ts.deck,
|
2021-10-24 14:50:00 +09:00
|
|
|
active: ui === 'deck',
|
2020-11-03 17:00:47 +09:00
|
|
|
action: () => {
|
|
|
|
localStorage.setItem('ui', 'deck');
|
2021-02-17 21:36:56 +09:00
|
|
|
unisonReload();
|
2022-06-20 17:38:49 +09:00
|
|
|
},
|
2021-04-10 12:40:50 +09:00
|
|
|
}, {
|
2022-01-28 11:39:49 +09:00
|
|
|
text: i18n.ts.classic,
|
2021-10-24 14:50:00 +09:00
|
|
|
active: ui === 'classic',
|
2021-04-10 12:40:50 +09:00
|
|
|
action: () => {
|
2021-10-24 14:50:00 +09:00
|
|
|
localStorage.setItem('ui', 'classic');
|
2021-04-10 12:40:50 +09:00
|
|
|
unisonReload();
|
2022-06-20 17:38:49 +09:00
|
|
|
},
|
|
|
|
}], ev.currentTarget ?? ev.target);
|
2020-10-17 20:12:00 +09:00
|
|
|
},
|
|
|
|
},
|
2022-07-05 19:29:44 +09:00
|
|
|
reload: {
|
|
|
|
title: 'reload',
|
|
|
|
icon: 'fas fa-refresh',
|
|
|
|
action: (ev) => {
|
|
|
|
location.reload();
|
|
|
|
},
|
|
|
|
},
|
2021-12-03 22:09:40 +09:00
|
|
|
});
|