2021-12-03 13:09:40 +00:00
|
|
|
import { computed, ref, reactive } from 'vue';
|
2022-06-20 08:38:49 +00:00
|
|
|
import { $i } from './account';
|
2021-11-11 17:02:25 +00: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 11:12:00 +00:00
|
|
|
|
2022-07-14 08:42:12 +00:00
|
|
|
export const navbarItemDef = reactive({
|
2020-10-17 11:12:00 +00:00
|
|
|
notifications: {
|
|
|
|
title: 'notifications',
|
2022-11-07 02:49:47 +00:00
|
|
|
icon: 'ph-bell-bold ph-lg',
|
2020-12-19 01:55:52 +00:00
|
|
|
show: computed(() => $i != null),
|
|
|
|
indicated: computed(() => $i != null && $i.hasUnreadNotification),
|
2020-10-17 11:12:00 +00:00
|
|
|
to: '/my/notifications',
|
|
|
|
},
|
|
|
|
messaging: {
|
|
|
|
title: 'messaging',
|
2022-11-07 02:49:47 +00:00
|
|
|
icon: 'ph-chats-teardrop-bold ph-lg',
|
2020-12-19 01:55:52 +00:00
|
|
|
show: computed(() => $i != null),
|
|
|
|
indicated: computed(() => $i != null && $i.hasUnreadMessagingMessage),
|
2020-11-03 01:43:50 +00:00
|
|
|
to: '/my/messaging',
|
2020-10-17 11:12:00 +00:00
|
|
|
},
|
|
|
|
drive: {
|
|
|
|
title: 'drive',
|
2022-11-07 02:49:47 +00:00
|
|
|
icon: 'ph-cloud-bold ph-lg',
|
2020-12-19 01:55:52 +00:00
|
|
|
show: computed(() => $i != null),
|
2020-10-17 11:12:00 +00:00
|
|
|
to: '/my/drive',
|
|
|
|
},
|
|
|
|
followRequests: {
|
|
|
|
title: 'followRequests',
|
2022-11-07 02:49:47 +00:00
|
|
|
icon: 'ph-hand-waving-bold ph-lg',
|
2020-12-19 01:55:52 +00:00
|
|
|
show: computed(() => $i != null && $i.isLocked),
|
|
|
|
indicated: computed(() => $i != null && $i.hasPendingReceivedFollowRequest),
|
2020-10-17 11:12:00 +00:00
|
|
|
to: '/my/follow-requests',
|
|
|
|
},
|
|
|
|
explore: {
|
|
|
|
title: 'explore',
|
2022-11-07 02:49:47 +00:00
|
|
|
icon: 'ph-hash-bold ph-lg',
|
2020-10-17 11:12:00 +00:00
|
|
|
to: '/explore',
|
|
|
|
},
|
|
|
|
announcements: {
|
|
|
|
title: 'announcements',
|
2022-11-07 02:49:47 +00:00
|
|
|
icon: 'ph-megaphone-simple-bold ph-lg',
|
2020-12-19 01:55:52 +00:00
|
|
|
indicated: computed(() => $i != null && $i.hasUnreadAnnouncement),
|
2020-10-17 11:12:00 +00:00
|
|
|
to: '/announcements',
|
|
|
|
},
|
|
|
|
search: {
|
|
|
|
title: 'search',
|
2022-11-07 02:49:47 +00:00
|
|
|
icon: 'ph-magnifying-glass-bold ph-lg',
|
2020-10-17 11:12:00 +00:00
|
|
|
action: () => search(),
|
|
|
|
},
|
|
|
|
lists: {
|
|
|
|
title: 'lists',
|
2022-11-07 02:49:47 +00:00
|
|
|
icon: 'ph-list-bullets-bold ph-lg',
|
2020-12-19 01:55:52 +00:00
|
|
|
show: computed(() => $i != null),
|
2022-07-07 08:28:13 +00:00
|
|
|
to: '/my/lists',
|
2020-10-17 11:12:00 +00:00
|
|
|
},
|
2022-06-30 01:53:40 +00:00
|
|
|
/*
|
2020-10-17 11:12:00 +00:00
|
|
|
groups: {
|
|
|
|
title: 'groups',
|
2022-11-07 20:29:56 +00:00
|
|
|
icon: 'ph-users-three-bold ph-lg',
|
2020-12-19 01:55:52 +00:00
|
|
|
show: computed(() => $i != null),
|
2020-10-17 11:12:00 +00:00
|
|
|
to: '/my/groups',
|
|
|
|
},
|
2022-06-30 01:53:40 +00:00
|
|
|
*/
|
2020-10-17 11:12:00 +00:00
|
|
|
antennas: {
|
|
|
|
title: 'antennas',
|
2022-11-07 02:49:47 +00:00
|
|
|
icon: 'ph-flying-saucer-bold ph-lg',
|
2020-12-19 01:55:52 +00:00
|
|
|
show: computed(() => $i != null),
|
2022-07-07 08:28:13 +00:00
|
|
|
to: '/my/antennas',
|
2020-10-17 11:12:00 +00:00
|
|
|
},
|
|
|
|
favorites: {
|
|
|
|
title: 'favorites',
|
2022-12-04 00:02:03 +00:00
|
|
|
icon: 'ph-bookmark-simple-bold ph-lg',
|
2020-12-19 01:55:52 +00:00
|
|
|
show: computed(() => $i != null),
|
2020-10-17 11:12:00 +00:00
|
|
|
to: '/my/favorites',
|
|
|
|
},
|
|
|
|
pages: {
|
|
|
|
title: 'pages',
|
2022-11-07 02:49:47 +00:00
|
|
|
icon: 'ph-file-text-bold ph-lg',
|
2020-11-17 05:59:15 +00:00
|
|
|
to: '/pages',
|
2020-10-17 11:12:00 +00:00
|
|
|
},
|
2021-04-24 13:38:24 +00:00
|
|
|
gallery: {
|
|
|
|
title: 'gallery',
|
2022-11-07 02:49:47 +00:00
|
|
|
icon: 'ph-image-square-bold ph-lg',
|
2021-04-24 13:38:24 +00:00
|
|
|
to: '/gallery',
|
|
|
|
},
|
2020-11-15 03:04:54 +00:00
|
|
|
clips: {
|
|
|
|
title: 'clip',
|
2022-11-07 02:49:47 +00:00
|
|
|
icon: 'ph-paperclip-bold ph-lg',
|
2020-12-19 01:55:52 +00:00
|
|
|
show: computed(() => $i != null),
|
2020-11-15 03:04:54 +00:00
|
|
|
to: '/my/clips',
|
|
|
|
},
|
2020-10-17 11:12:00 +00:00
|
|
|
channels: {
|
|
|
|
title: 'channel',
|
2022-11-07 02:49:47 +00:00
|
|
|
icon: 'ph-television-bold ph-lg',
|
2020-10-17 11:12:00 +00:00
|
|
|
to: '/channels',
|
|
|
|
},
|
2022-09-13 23:53:34 +00:00
|
|
|
groups: {
|
|
|
|
title: 'groups',
|
2022-11-07 20:29:56 +00:00
|
|
|
icon: 'ph-users-three-bold ph-lg',
|
2022-09-13 23:53:34 +00:00
|
|
|
to: '/my/groups',
|
|
|
|
},
|
2020-11-03 08:00:47 +00:00
|
|
|
ui: {
|
|
|
|
title: 'switchUi',
|
2022-11-07 02:49:47 +00:00
|
|
|
icon: 'ph-layout-bold ph-lg',
|
2020-11-03 08:00:47 +00:00
|
|
|
action: (ev) => {
|
2021-08-08 03:19:10 +00:00
|
|
|
os.popupMenu([{
|
2022-01-28 02:39:49 +00:00
|
|
|
text: i18n.ts.default,
|
2021-10-24 05:50:00 +00:00
|
|
|
active: ui === 'default' || ui === null,
|
2020-11-03 08:00:47 +00:00
|
|
|
action: () => {
|
|
|
|
localStorage.setItem('ui', 'default');
|
2021-02-17 12:36:56 +00:00
|
|
|
unisonReload();
|
2022-06-20 08:38:49 +00:00
|
|
|
},
|
2020-11-03 08:00:47 +00:00
|
|
|
}, {
|
2022-01-28 02:39:49 +00:00
|
|
|
text: i18n.ts.deck,
|
2021-10-24 05:50:00 +00:00
|
|
|
active: ui === 'deck',
|
2020-11-03 08:00:47 +00:00
|
|
|
action: () => {
|
|
|
|
localStorage.setItem('ui', 'deck');
|
2021-02-17 12:36:56 +00:00
|
|
|
unisonReload();
|
2022-06-20 08:38:49 +00:00
|
|
|
},
|
2021-04-10 03:40:50 +00:00
|
|
|
}, {
|
2022-01-28 02:39:49 +00:00
|
|
|
text: i18n.ts.classic,
|
2021-10-24 05:50:00 +00:00
|
|
|
active: ui === 'classic',
|
2021-04-10 03:40:50 +00:00
|
|
|
action: () => {
|
2021-10-24 05:50:00 +00:00
|
|
|
localStorage.setItem('ui', 'classic');
|
2021-04-10 03:40:50 +00:00
|
|
|
unisonReload();
|
2022-06-20 08:38:49 +00:00
|
|
|
},
|
|
|
|
}], ev.currentTarget ?? ev.target);
|
2020-10-17 11:12:00 +00:00
|
|
|
},
|
|
|
|
},
|
2022-07-05 10:29:44 +00:00
|
|
|
reload: {
|
|
|
|
title: 'reload',
|
2022-11-07 02:49:47 +00:00
|
|
|
icon: 'ph-arrows-clockwise-bold ph-lg',
|
2022-07-05 10:29:44 +00:00
|
|
|
action: (ev) => {
|
|
|
|
location.reload();
|
|
|
|
},
|
|
|
|
},
|
2021-12-03 13:09:40 +00:00
|
|
|
});
|