2021-12-03 07:09:40 -06:00
|
|
|
import { computed, ref, reactive } from 'vue';
|
2022-06-20 03:38:49 -05:00
|
|
|
import { $i } from './account';
|
2023-01-20 22:14:55 -06:00
|
|
|
import { miLocalStorage } from './local-storage';
|
2021-11-11 11:02:25 -06: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 06:12:00 -05:00
|
|
|
|
2022-07-14 03:42:12 -05:00
|
|
|
export const navbarItemDef = reactive({
|
2020-10-17 06:12:00 -05:00
|
|
|
notifications: {
|
2023-01-04 22:59:48 -06:00
|
|
|
title: i18n.ts.notifications,
|
2022-12-19 04:01:30 -06:00
|
|
|
icon: 'ti ti-bell',
|
2020-12-18 19:55:52 -06:00
|
|
|
show: computed(() => $i != null),
|
|
|
|
indicated: computed(() => $i != null && $i.hasUnreadNotification),
|
2020-10-17 06:12:00 -05:00
|
|
|
to: '/my/notifications',
|
|
|
|
},
|
|
|
|
messaging: {
|
2023-01-04 22:59:48 -06:00
|
|
|
title: i18n.ts.messaging,
|
2022-12-19 04:01:30 -06:00
|
|
|
icon: 'ti ti-messages',
|
2020-12-18 19:55:52 -06:00
|
|
|
show: computed(() => $i != null),
|
|
|
|
indicated: computed(() => $i != null && $i.hasUnreadMessagingMessage),
|
2020-11-02 19:43:50 -06:00
|
|
|
to: '/my/messaging',
|
2020-10-17 06:12:00 -05:00
|
|
|
},
|
|
|
|
drive: {
|
2023-01-04 22:59:48 -06:00
|
|
|
title: i18n.ts.drive,
|
2022-12-19 04:01:30 -06:00
|
|
|
icon: 'ti ti-cloud',
|
2020-12-18 19:55:52 -06:00
|
|
|
show: computed(() => $i != null),
|
2020-10-17 06:12:00 -05:00
|
|
|
to: '/my/drive',
|
|
|
|
},
|
|
|
|
followRequests: {
|
2023-01-04 22:59:48 -06:00
|
|
|
title: i18n.ts.followRequests,
|
2022-12-26 02:15:30 -06:00
|
|
|
icon: 'ti ti-user-plus',
|
2020-12-18 19:55:52 -06:00
|
|
|
show: computed(() => $i != null && $i.isLocked),
|
|
|
|
indicated: computed(() => $i != null && $i.hasPendingReceivedFollowRequest),
|
2020-10-17 06:12:00 -05:00
|
|
|
to: '/my/follow-requests',
|
|
|
|
},
|
|
|
|
explore: {
|
2023-01-04 22:59:48 -06:00
|
|
|
title: i18n.ts.explore,
|
2022-12-19 04:01:30 -06:00
|
|
|
icon: 'ti ti-hash',
|
2020-10-17 06:12:00 -05:00
|
|
|
to: '/explore',
|
|
|
|
},
|
|
|
|
announcements: {
|
2023-01-04 22:59:48 -06:00
|
|
|
title: i18n.ts.announcements,
|
2022-12-19 04:01:30 -06:00
|
|
|
icon: 'ti ti-speakerphone',
|
2020-12-18 19:55:52 -06:00
|
|
|
indicated: computed(() => $i != null && $i.hasUnreadAnnouncement),
|
2020-10-17 06:12:00 -05:00
|
|
|
to: '/announcements',
|
|
|
|
},
|
|
|
|
search: {
|
2023-01-04 22:59:48 -06:00
|
|
|
title: i18n.ts.search,
|
2022-12-19 04:01:30 -06:00
|
|
|
icon: 'ti ti-search',
|
2020-10-17 06:12:00 -05:00
|
|
|
action: () => search(),
|
|
|
|
},
|
|
|
|
lists: {
|
2023-01-04 22:59:48 -06:00
|
|
|
title: i18n.ts.lists,
|
2022-12-19 04:01:30 -06:00
|
|
|
icon: 'ti ti-list',
|
2020-12-18 19:55:52 -06:00
|
|
|
show: computed(() => $i != null),
|
2022-07-07 03:28:13 -05:00
|
|
|
to: '/my/lists',
|
2020-10-17 06:12:00 -05:00
|
|
|
},
|
2022-06-29 20:53:40 -05:00
|
|
|
/*
|
2020-10-17 06:12:00 -05:00
|
|
|
groups: {
|
2023-01-04 22:59:48 -06:00
|
|
|
title: i18n.ts.groups,
|
2022-12-19 04:01:30 -06:00
|
|
|
icon: 'ti ti-users',
|
2020-12-18 19:55:52 -06:00
|
|
|
show: computed(() => $i != null),
|
2020-10-17 06:12:00 -05:00
|
|
|
to: '/my/groups',
|
|
|
|
},
|
2022-06-29 20:53:40 -05:00
|
|
|
*/
|
2020-10-17 06:12:00 -05:00
|
|
|
antennas: {
|
2023-01-04 22:59:48 -06:00
|
|
|
title: i18n.ts.antennas,
|
2022-12-19 04:01:30 -06:00
|
|
|
icon: 'ti ti-antenna',
|
2020-12-18 19:55:52 -06:00
|
|
|
show: computed(() => $i != null),
|
2022-07-07 03:28:13 -05:00
|
|
|
to: '/my/antennas',
|
2020-10-17 06:12:00 -05:00
|
|
|
},
|
|
|
|
favorites: {
|
2023-01-04 22:59:48 -06:00
|
|
|
title: i18n.ts.favorites,
|
2022-12-19 04:01:30 -06:00
|
|
|
icon: 'ti ti-star',
|
2020-12-18 19:55:52 -06:00
|
|
|
show: computed(() => $i != null),
|
2020-10-17 06:12:00 -05:00
|
|
|
to: '/my/favorites',
|
|
|
|
},
|
|
|
|
pages: {
|
2023-01-04 22:59:48 -06:00
|
|
|
title: i18n.ts.pages,
|
2022-12-19 17:35:49 -06:00
|
|
|
icon: 'ti ti-news',
|
2020-11-16 23:59:15 -06:00
|
|
|
to: '/pages',
|
2020-10-17 06:12:00 -05:00
|
|
|
},
|
2023-01-04 22:59:48 -06:00
|
|
|
play: {
|
|
|
|
title: 'Play',
|
|
|
|
icon: 'ti ti-player-play',
|
|
|
|
to: '/play',
|
|
|
|
},
|
2021-04-24 08:38:24 -05:00
|
|
|
gallery: {
|
2023-01-04 22:59:48 -06:00
|
|
|
title: i18n.ts.gallery,
|
2022-12-19 04:01:30 -06:00
|
|
|
icon: 'ti ti-icons',
|
2021-04-24 08:38:24 -05:00
|
|
|
to: '/gallery',
|
|
|
|
},
|
2020-11-14 21:04:54 -06:00
|
|
|
clips: {
|
2023-01-04 22:59:48 -06:00
|
|
|
title: i18n.ts.clip,
|
2022-12-19 04:01:30 -06:00
|
|
|
icon: 'ti ti-paperclip',
|
2020-12-18 19:55:52 -06:00
|
|
|
show: computed(() => $i != null),
|
2020-11-14 21:04:54 -06:00
|
|
|
to: '/my/clips',
|
|
|
|
},
|
2020-10-17 06:12:00 -05:00
|
|
|
channels: {
|
2023-01-04 22:59:48 -06:00
|
|
|
title: i18n.ts.channel,
|
2022-12-19 04:01:30 -06:00
|
|
|
icon: 'ti ti-device-tv',
|
2020-10-17 06:12:00 -05:00
|
|
|
to: '/channels',
|
|
|
|
},
|
2023-01-20 22:14:55 -06:00
|
|
|
achievements: {
|
|
|
|
title: i18n.ts.achievements,
|
|
|
|
icon: 'ti ti-military-award',
|
|
|
|
show: computed(() => $i != null),
|
|
|
|
to: '/my/achievements',
|
|
|
|
},
|
2020-11-03 02:00:47 -06:00
|
|
|
ui: {
|
2023-01-04 22:59:48 -06:00
|
|
|
title: i18n.ts.switchUi,
|
2022-12-20 17:39:28 -06:00
|
|
|
icon: 'ti ti-devices',
|
2020-11-03 02:00:47 -06:00
|
|
|
action: (ev) => {
|
2021-08-07 22:19:10 -05:00
|
|
|
os.popupMenu([{
|
2022-01-27 20:39:49 -06:00
|
|
|
text: i18n.ts.default,
|
2021-10-24 00:50:00 -05:00
|
|
|
active: ui === 'default' || ui === null,
|
2020-11-03 02:00:47 -06:00
|
|
|
action: () => {
|
2023-01-06 19:13:02 -06:00
|
|
|
miLocalStorage.setItem('ui', 'default');
|
2021-02-17 06:36:56 -06:00
|
|
|
unisonReload();
|
2022-06-20 03:38:49 -05:00
|
|
|
},
|
2020-11-03 02:00:47 -06:00
|
|
|
}, {
|
2022-01-27 20:39:49 -06:00
|
|
|
text: i18n.ts.deck,
|
2021-10-24 00:50:00 -05:00
|
|
|
active: ui === 'deck',
|
2020-11-03 02:00:47 -06:00
|
|
|
action: () => {
|
2023-01-06 19:13:02 -06:00
|
|
|
miLocalStorage.setItem('ui', 'deck');
|
2021-02-17 06:36:56 -06:00
|
|
|
unisonReload();
|
2022-06-20 03:38:49 -05:00
|
|
|
},
|
2021-04-09 22:40:50 -05:00
|
|
|
}, {
|
2022-01-27 20:39:49 -06:00
|
|
|
text: i18n.ts.classic,
|
2021-10-24 00:50:00 -05:00
|
|
|
active: ui === 'classic',
|
2021-04-09 22:40:50 -05:00
|
|
|
action: () => {
|
2023-01-06 19:13:02 -06:00
|
|
|
miLocalStorage.setItem('ui', 'classic');
|
2021-04-09 22:40:50 -05:00
|
|
|
unisonReload();
|
2022-06-20 03:38:49 -05:00
|
|
|
},
|
|
|
|
}], ev.currentTarget ?? ev.target);
|
2020-10-17 06:12:00 -05:00
|
|
|
},
|
|
|
|
},
|
2022-07-05 05:29:44 -05:00
|
|
|
reload: {
|
2023-01-04 22:59:48 -06:00
|
|
|
title: i18n.ts.reload,
|
2022-12-19 04:01:30 -06:00
|
|
|
icon: 'ti ti-refresh',
|
2022-07-05 05:29:44 -05:00
|
|
|
action: (ev) => {
|
|
|
|
location.reload();
|
|
|
|
},
|
|
|
|
},
|
2021-12-03 07:09:40 -06:00
|
|
|
});
|