From 3b52022d9d55f60ec0ad0d4212e5834a4f39bf22 Mon Sep 17 00:00:00 2001 From: Crimekillz Date: Wed, 1 May 2024 18:34:35 +0200 Subject: [PATCH] Unified Messaging: Move channel management to Messenger --- packages/client/src/navbar.ts | 5 -- packages/client/src/pages/channel-editor.vue | 2 +- packages/client/src/pages/channels.vue | 54 ++----------------- packages/client/src/pages/messaging/index.vue | 46 +++++++--------- packages/client/src/ui/universal.vue | 14 +++++ 5 files changed, 37 insertions(+), 84 deletions(-) diff --git a/packages/client/src/navbar.ts b/packages/client/src/navbar.ts index 5a128d83c..a9ed1f08d 100644 --- a/packages/client/src/navbar.ts +++ b/packages/client/src/navbar.ts @@ -79,11 +79,6 @@ export const navbarItemDef = reactive({ icon: "ph-film-strip ph-bold ph-lg", to: "/gallery", }, - channels: { - title: "channel", - icon: "ph-television ph-bold ph-lg", - to: "/channels", - }, achievements: { title: "achievements", icon: "ph-medal-military ph-bold ph-lg", diff --git a/packages/client/src/pages/channel-editor.vue b/packages/client/src/pages/channel-editor.vue index 203c69770..fe3477542 100644 --- a/packages/client/src/pages/channel-editor.vue +++ b/packages/client/src/pages/channel-editor.vue @@ -1,7 +1,7 @@ {{ @@ -66,39 +67,11 @@ - - - - -
- -
-
+ >{{ i18n.ts._channel.create }} syncSlide(tabs.indexOf(tab))); @@ -149,15 +122,6 @@ onMounted(() => { searchType = props.type ?? "nameAndDescription"; }); -const featuredPagination = { - endpoint: "channels/featured" as const, - limit: 10, - noPaging: false, -}; -const followingPagination = { - endpoint: "channels/followed" as const, - limit: 10, -}; const ownedPagination = { endpoint: "channels/owned" as const, limit: 10, @@ -196,16 +160,6 @@ const headerTabs = $computed(() => [ title: i18n.ts.search, icon: "ph-magnifying-glass ph-bold ph-lg", }, - { - key: "featured", - title: i18n.ts._channel.featured, - icon: "ph-fire-simple ph-bold ph-lg", - }, - { - key: "following", - title: i18n.ts._channel.following, - icon: "ph-heart ph-bold ph-lg", - }, { key: "owned", title: i18n.ts._channel.owned, @@ -216,7 +170,7 @@ const headerTabs = $computed(() => [ definePageMetadata( computed(() => ({ title: i18n.ts.channel, - icon: "ph-television ph-bold ph-lg", + icon: "ph-megaphone-simple ph-bold ph-lg", })), ); diff --git a/packages/client/src/pages/messaging/index.vue b/packages/client/src/pages/messaging/index.vue index 3ee047c79..aa877edd6 100644 --- a/packages/client/src/pages/messaging/index.vue +++ b/packages/client/src/pages/messaging/index.vue @@ -87,17 +87,25 @@ primary class="start" v-if="!isMobile" - @click="createChannel" - > - {{ i18n.ts._channel.create }} + {{ i18n.ts.announcements }} - {{ i18n.ts.announcements }} + {{ i18n.ts._channel.owned }} + + {{ i18n.ts._channel.create }} { - startUser(); - }, - }, - { - text: i18n.ts.messagingWithGroup, - icon: "ph-users-three ph-bold ph-lg", - action: () => { - startGroup(); - }, - }, - ], - ev.currentTarget ?? ev.target, - ); -} - async function startUser(): void { os.selectUser().then((user) => { router.push(`/my/messaging/${Acct.toString(user)}`); @@ -290,6 +276,10 @@ function createChannel() { router.push("/channels/new"); } +function manageChannel() { + router.push("/channels"); +} + function visitAnnouncements() { router.push("/announcements"); } diff --git a/packages/client/src/ui/universal.vue b/packages/client/src/ui/universal.vue index 9e8eedc9c..233bf2aa5 100644 --- a/packages/client/src/ui/universal.vue +++ b/packages/client/src/ui/universal.vue @@ -286,6 +286,13 @@ function messagingStart(ev) { startGroup(); }, }, + { + text: i18n.ts._channel.create, + icon: "ph-plus ph-bold ph-lg", + action: () => { + mainRouter.push("/channels/new"); + }, + }, { text: i18n.ts.manageGroups, icon: "ph-user-circle-gear ph-bold ph-lg", @@ -293,6 +300,13 @@ function messagingStart(ev) { mainRouter.push("/my/groups"); }, }, + { + text: i18n.ts._channel.owned, + icon: "ph-gear-fine ph-bold ph-lg", + action: () => { + mainRouter.push("/channels"); + }, + }, ], ev.currentTarget ?? ev.target, );