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