From 0f14568c370763f358ec9bad72e395257a816402 Mon Sep 17 00:00:00 2001 From: Aylam Date: Fri, 4 Aug 2023 19:15:45 +0300 Subject: [PATCH] Improve navbar --- locales/en-US.yml | 2 +- packages/client/src/navbar.ts | 20 +++++++++++++++---- packages/client/src/store.ts | 5 +++-- .../src/ui/_common_/navbar-for-mobile.vue | 13 +----------- packages/client/src/ui/_common_/navbar.vue | 13 +----------- 5 files changed, 22 insertions(+), 31 deletions(-) diff --git a/locales/en-US.yml b/locales/en-US.yml index 0636c7072..3977780da 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -275,7 +275,7 @@ currentPassword: "Current password" newPassword: "New password" newPasswordRetype: "Retype new password" attachFile: "Attach files" -more: "More!" +more: "More" featured: "Featured" usernameOrUserId: "Username or user id" noSuchUser: "User not found" diff --git a/packages/client/src/navbar.ts b/packages/client/src/navbar.ts index f8383357b..3a322c7f0 100644 --- a/packages/client/src/navbar.ts +++ b/packages/client/src/navbar.ts @@ -9,6 +9,7 @@ import { defaultStore } from "@/store"; import { instance } from "@/instance"; import { host } from "@/config"; import XTutorial from "@/components/MkTutorialDialog.vue"; +import { openHelpMenu_ } from "@/scripts/helpMenu"; export const navbarItemDef = reactive({ notifications: { @@ -40,7 +41,7 @@ export const navbarItemDef = reactive({ }, explore: { title: "explore", - icon: "ph-compass ph-bold ph-lg", + icon: "ph-hash ph-bold ph-lg", to: "/explore", }, announcements: { @@ -141,11 +142,22 @@ export const navbarItemDef = reactive({ ); }, }, + help: { + title: "help", + icon: "ph-info ph-bold ph-lg", + action: (ev) => { + openHelpMenu(ev); + }, + }, reload: { title: "reload", icon: "ph-arrows-clockwise ph-bold ph-lg", - action: (ev) => { + action: () => { location.reload(); - }, - }, + } + } }); + +function openHelpMenu(ev: MouseEvent) { + openHelpMenu_(ev); +} diff --git a/packages/client/src/store.ts b/packages/client/src/store.ts index 460453485..0dfaf0ee7 100644 --- a/packages/client/src/store.ts +++ b/packages/client/src/store.ts @@ -12,9 +12,10 @@ const menuOptions = [ "notifications", "followRequests", "messaging", - "explore", + "-", "favorites", - "channels", + "announcements", + "explore", "search", ]; diff --git a/packages/client/src/ui/_common_/navbar-for-mobile.vue b/packages/client/src/ui/_common_/navbar-for-mobile.vue index 08bb8c71b..8796010dd 100644 --- a/packages/client/src/ui/_common_/navbar-for-mobile.vue +++ b/packages/client/src/ui/_common_/navbar-for-mobile.vue @@ -80,6 +80,7 @@ {{ i18n.ts.controlPanel }} +
- @@ -135,7 +129,6 @@ import { import * as os from "@/os"; import { navbarItemDef } from "@/navbar"; import { openAccountMenu as openAccountMenu_ } from "@/account"; -import { openHelpMenu_ } from "@/scripts/helpMenu"; import { defaultStore } from "@/store"; import { i18n } from "@/i18n"; @@ -157,10 +150,6 @@ function openAccountMenu(ev: MouseEvent) { ); } -function openHelpMenu(ev: MouseEvent) { - openHelpMenu_(ev); -} - function more() { os.popup( defineAsyncComponent(() => import("@/components/MkLaunchPad.vue")), diff --git a/packages/client/src/ui/_common_/navbar.vue b/packages/client/src/ui/_common_/navbar.vue index 9ae0de1d5..a8ffd4a44 100644 --- a/packages/client/src/ui/_common_/navbar.vue +++ b/packages/client/src/ui/_common_/navbar.vue @@ -92,6 +92,7 @@ >{{ i18n.ts.controlPanel }} +
- @@ -150,7 +144,6 @@ import { computed, defineAsyncComponent, ref, watch } from "vue"; import * as os from "@/os"; import { navbarItemDef } from "@/navbar"; import { $i, openAccountMenu as openAccountMenu_ } from "@/account"; -import { openHelpMenu_ } from "@/scripts/helpMenu"; import { defaultStore } from "@/store"; import { i18n } from "@/i18n"; import { instance } from "@/instance"; @@ -221,10 +214,6 @@ function openAccountMenu(ev: MouseEvent) { ); } -function openHelpMenu(ev: MouseEvent) { - openHelpMenu_(ev); -} - function more(ev: MouseEvent) { os.popup( defineAsyncComponent(() => import("@/components/MkLaunchPad.vue")),