2023-01-12 21:40:33 -07:00
|
|
|
import { computed, ref, reactive } from "vue";
|
|
|
|
import { $i } from "./account";
|
|
|
|
import { search } from "@/scripts/search";
|
|
|
|
import * as os from "@/os";
|
|
|
|
import { i18n } from "@/i18n";
|
|
|
|
import { ui } from "@/config";
|
|
|
|
import { unisonReload } from "@/scripts/unison-reload";
|
2023-02-10 16:41:19 -07:00
|
|
|
import { defaultStore } from "@/store";
|
|
|
|
import { instance } from "@/instance";
|
|
|
|
import { host } from "@/config";
|
2023-10-25 12:30:32 -06:00
|
|
|
import XTutorial from "@/components/MkTutorialDialog.vue";
|
2023-08-04 10:15:45 -06:00
|
|
|
import { openHelpMenu_ } from "@/scripts/helpMenu";
|
2020-10-17 05:12:00 -06:00
|
|
|
|
2022-07-14 02:42:12 -06:00
|
|
|
export const navbarItemDef = reactive({
|
2020-10-17 05:12:00 -06:00
|
|
|
notifications: {
|
2023-01-12 21:40:33 -07:00
|
|
|
title: "notifications",
|
2023-03-11 14:01:04 -07:00
|
|
|
icon: "ph-bell ph-bold ph-lg",
|
2020-12-18 18:55:52 -07:00
|
|
|
show: computed(() => $i != null),
|
2023-01-12 21:40:33 -07:00
|
|
|
indicated: computed(() => $i?.hasUnreadNotification),
|
|
|
|
to: "/my/notifications",
|
2020-10-17 05:12:00 -06:00
|
|
|
},
|
|
|
|
messaging: {
|
2023-01-12 21:40:33 -07:00
|
|
|
title: "messaging",
|
2023-03-11 14:01:04 -07:00
|
|
|
icon: "ph-chats-teardrop ph-bold ph-lg",
|
2020-12-18 18:55:52 -07:00
|
|
|
show: computed(() => $i != null),
|
2023-01-12 21:40:33 -07:00
|
|
|
indicated: computed(() => $i?.hasUnreadMessagingMessage),
|
|
|
|
to: "/my/messaging",
|
2020-10-17 05:12:00 -06:00
|
|
|
},
|
|
|
|
drive: {
|
2023-01-12 21:40:33 -07:00
|
|
|
title: "drive",
|
2023-03-11 14:01:04 -07:00
|
|
|
icon: "ph-cloud ph-bold ph-lg",
|
2020-12-18 18:55:52 -07:00
|
|
|
show: computed(() => $i != null),
|
2023-01-12 21:40:33 -07:00
|
|
|
to: "/my/drive",
|
2020-10-17 05:12:00 -06:00
|
|
|
},
|
|
|
|
followRequests: {
|
2023-01-12 21:40:33 -07:00
|
|
|
title: "followRequests",
|
2023-03-11 14:01:04 -07:00
|
|
|
icon: "ph-hand-waving ph-bold ph-lg",
|
2023-05-19 23:52:14 -06:00
|
|
|
show: computed(() => $i?.isLocked || $i?.hasPendingReceivedFollowRequest),
|
2023-01-12 21:40:33 -07:00
|
|
|
indicated: computed(() => $i?.hasPendingReceivedFollowRequest),
|
|
|
|
to: "/my/follow-requests",
|
2020-10-17 05:12:00 -06:00
|
|
|
},
|
|
|
|
explore: {
|
2023-01-12 21:40:33 -07:00
|
|
|
title: "explore",
|
2023-08-04 10:15:45 -06:00
|
|
|
icon: "ph-hash ph-bold ph-lg",
|
2023-01-12 21:40:33 -07:00
|
|
|
to: "/explore",
|
2020-10-17 05:12:00 -06:00
|
|
|
},
|
|
|
|
announcements: {
|
2023-01-12 21:40:33 -07:00
|
|
|
title: "announcements",
|
2023-03-11 14:01:04 -07:00
|
|
|
icon: "ph-megaphone-simple ph-bold ph-lg",
|
2023-01-12 21:40:33 -07:00
|
|
|
indicated: computed(() => $i?.hasUnreadAnnouncement),
|
|
|
|
to: "/announcements",
|
2020-10-17 05:12:00 -06:00
|
|
|
},
|
|
|
|
search: {
|
2023-01-12 21:40:33 -07:00
|
|
|
title: "search",
|
2023-03-11 14:01:04 -07:00
|
|
|
icon: "ph-magnifying-glass ph-bold ph-lg",
|
2020-10-17 05:12:00 -06:00
|
|
|
action: () => search(),
|
|
|
|
},
|
|
|
|
lists: {
|
2023-01-12 21:40:33 -07:00
|
|
|
title: "lists",
|
2023-03-11 14:01:04 -07:00
|
|
|
icon: "ph-list-bullets ph-bold ph-lg",
|
2020-12-18 18:55:52 -07:00
|
|
|
show: computed(() => $i != null),
|
2023-01-12 21:40:33 -07:00
|
|
|
to: "/my/lists",
|
2020-10-17 05:12:00 -06:00
|
|
|
},
|
2022-06-29 19:53:40 -06:00
|
|
|
/*
|
2020-10-17 05:12:00 -06:00
|
|
|
groups: {
|
|
|
|
title: 'groups',
|
2023-03-11 14:01:04 -07:00
|
|
|
icon: 'ph-users-three ph-bold ph-lg',
|
2020-12-18 18:55:52 -07:00
|
|
|
show: computed(() => $i != null),
|
2020-10-17 05:12:00 -06:00
|
|
|
to: '/my/groups',
|
|
|
|
},
|
2022-06-29 19:53:40 -06:00
|
|
|
*/
|
2020-10-17 05:12:00 -06:00
|
|
|
antennas: {
|
2023-01-12 21:40:33 -07:00
|
|
|
title: "antennas",
|
2023-03-11 14:01:04 -07:00
|
|
|
icon: "ph-flying-saucer ph-bold ph-lg",
|
2020-12-18 18:55:52 -07:00
|
|
|
show: computed(() => $i != null),
|
2023-01-12 21:40:33 -07:00
|
|
|
to: "/my/antennas",
|
2020-10-17 05:12:00 -06:00
|
|
|
},
|
|
|
|
favorites: {
|
2023-01-12 21:40:33 -07:00
|
|
|
title: "favorites",
|
2023-03-11 14:01:04 -07:00
|
|
|
icon: "ph-bookmark-simple ph-bold ph-lg",
|
2020-12-18 18:55:52 -07:00
|
|
|
show: computed(() => $i != null),
|
2023-01-12 21:40:33 -07:00
|
|
|
to: "/my/favorites",
|
2020-10-17 05:12:00 -06:00
|
|
|
},
|
|
|
|
pages: {
|
2023-01-12 21:40:33 -07:00
|
|
|
title: "pages",
|
2023-03-11 14:01:04 -07:00
|
|
|
icon: "ph-file-text ph-bold ph-lg",
|
2023-01-12 21:40:33 -07:00
|
|
|
to: "/pages",
|
2020-10-17 05:12:00 -06:00
|
|
|
},
|
2021-04-24 07:38:24 -06:00
|
|
|
gallery: {
|
2023-01-12 21:40:33 -07:00
|
|
|
title: "gallery",
|
2023-03-11 14:01:04 -07:00
|
|
|
icon: "ph-image-square ph-bold ph-lg",
|
2023-01-12 21:40:33 -07:00
|
|
|
to: "/gallery",
|
2021-04-24 07:38:24 -06:00
|
|
|
},
|
2020-11-14 20:04:54 -07:00
|
|
|
clips: {
|
2023-06-04 13:39:23 -06:00
|
|
|
title: "clips",
|
2023-03-11 14:01:04 -07:00
|
|
|
icon: "ph-paperclip ph-bold ph-lg",
|
2020-12-18 18:55:52 -07:00
|
|
|
show: computed(() => $i != null),
|
2023-01-12 21:40:33 -07:00
|
|
|
to: "/my/clips",
|
2020-11-14 20:04:54 -07:00
|
|
|
},
|
2020-10-17 05:12:00 -06:00
|
|
|
channels: {
|
2023-01-12 21:40:33 -07:00
|
|
|
title: "channel",
|
2023-03-11 14:01:04 -07:00
|
|
|
icon: "ph-television ph-bold ph-lg",
|
2023-01-12 21:40:33 -07:00
|
|
|
to: "/channels",
|
2020-10-17 05:12:00 -06:00
|
|
|
},
|
2022-09-13 17:53:34 -06:00
|
|
|
groups: {
|
2023-01-12 21:40:33 -07:00
|
|
|
title: "groups",
|
2023-03-11 14:01:04 -07:00
|
|
|
icon: "ph-users-three ph-bold ph-lg",
|
2023-01-12 21:40:33 -07:00
|
|
|
to: "/my/groups",
|
2022-09-13 17:53:34 -06:00
|
|
|
},
|
2020-11-03 01:00:47 -07:00
|
|
|
ui: {
|
2023-01-12 21:40:33 -07:00
|
|
|
title: "switchUi",
|
2023-03-11 14:01:04 -07:00
|
|
|
icon: "ph-layout ph-bold ph-lg",
|
2020-11-03 01:00:47 -07:00
|
|
|
action: (ev) => {
|
2023-01-12 21:40:33 -07:00
|
|
|
os.popupMenu(
|
|
|
|
[
|
|
|
|
{
|
|
|
|
text: i18n.ts.default,
|
|
|
|
active: ui === "default" || ui === null,
|
|
|
|
action: () => {
|
|
|
|
localStorage.setItem("ui", "default");
|
|
|
|
unisonReload();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2023-05-14 17:10:48 -06:00
|
|
|
text: i18n.ts.deck,
|
|
|
|
active: ui === "deck",
|
2023-01-12 21:40:33 -07:00
|
|
|
action: () => {
|
2023-05-14 17:10:48 -06:00
|
|
|
localStorage.setItem("ui", "deck");
|
2023-01-12 21:40:33 -07:00
|
|
|
unisonReload();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
ev.currentTarget ?? ev.target,
|
|
|
|
);
|
2020-10-17 05:12:00 -06:00
|
|
|
},
|
|
|
|
},
|
2023-08-04 10:15:45 -06:00
|
|
|
help: {
|
|
|
|
title: "help",
|
|
|
|
icon: "ph-info ph-bold ph-lg",
|
|
|
|
action: (ev) => {
|
|
|
|
openHelpMenu(ev);
|
|
|
|
},
|
|
|
|
},
|
2022-07-05 04:29:44 -06:00
|
|
|
reload: {
|
2023-01-12 21:40:33 -07:00
|
|
|
title: "reload",
|
2023-03-11 14:01:04 -07:00
|
|
|
icon: "ph-arrows-clockwise ph-bold ph-lg",
|
2023-08-04 10:15:45 -06:00
|
|
|
action: () => {
|
2022-07-05 04:29:44 -06:00
|
|
|
location.reload();
|
2023-10-25 12:30:32 -06:00
|
|
|
}
|
|
|
|
}
|
2021-12-03 06:09:40 -07:00
|
|
|
});
|
2023-08-04 10:15:45 -06:00
|
|
|
|
|
|
|
function openHelpMenu(ev: MouseEvent) {
|
|
|
|
openHelpMenu_(ev);
|
|
|
|
}
|