Improve navbar

This commit is contained in:
Aylam 2023-08-04 19:15:45 +03:00 committed by aylamz
parent 3c0de95e41
commit 0f14568c37
5 changed files with 22 additions and 31 deletions

View File

@ -275,7 +275,7 @@ currentPassword: "Current password"
newPassword: "New password" newPassword: "New password"
newPasswordRetype: "Retype new password" newPasswordRetype: "Retype new password"
attachFile: "Attach files" attachFile: "Attach files"
more: "More!" more: "More"
featured: "Featured" featured: "Featured"
usernameOrUserId: "Username or user id" usernameOrUserId: "Username or user id"
noSuchUser: "User not found" noSuchUser: "User not found"

View File

@ -9,6 +9,7 @@ import { defaultStore } from "@/store";
import { instance } from "@/instance"; import { instance } from "@/instance";
import { host } from "@/config"; import { host } from "@/config";
import XTutorial from "@/components/MkTutorialDialog.vue"; import XTutorial from "@/components/MkTutorialDialog.vue";
import { openHelpMenu_ } from "@/scripts/helpMenu";
export const navbarItemDef = reactive({ export const navbarItemDef = reactive({
notifications: { notifications: {
@ -40,7 +41,7 @@ export const navbarItemDef = reactive({
}, },
explore: { explore: {
title: "explore", title: "explore",
icon: "ph-compass ph-bold ph-lg", icon: "ph-hash ph-bold ph-lg",
to: "/explore", to: "/explore",
}, },
announcements: { announcements: {
@ -141,11 +142,22 @@ export const navbarItemDef = reactive({
); );
}, },
}, },
help: {
title: "help",
icon: "ph-info ph-bold ph-lg",
action: (ev) => {
openHelpMenu(ev);
},
},
reload: { reload: {
title: "reload", title: "reload",
icon: "ph-arrows-clockwise ph-bold ph-lg", icon: "ph-arrows-clockwise ph-bold ph-lg",
action: (ev) => { action: () => {
location.reload(); location.reload();
}, }
}, }
}); });
function openHelpMenu(ev: MouseEvent) {
openHelpMenu_(ev);
}

View File

@ -12,9 +12,10 @@ const menuOptions = [
"notifications", "notifications",
"followRequests", "followRequests",
"messaging", "messaging",
"explore", "-",
"favorites", "favorites",
"channels", "announcements",
"explore",
"search", "search",
]; ];

View File

@ -80,6 +80,7 @@
<i class="icon ph-door ph-bold ph-lg ph-fw ph-lg"></i <i class="icon ph-door ph-bold ph-lg ph-fw ph-lg"></i
><span class="text">{{ i18n.ts.controlPanel }}</span> ><span class="text">{{ i18n.ts.controlPanel }}</span>
</MkA> </MkA>
<div class="divider" v-if="$i.isAdmin || $i.isModerator"></div>
<button v-click-anime class="item _button" @click="more"> <button v-click-anime class="item _button" @click="more">
<i <i
class="icon ph-dots-three-outline ph-bold ph-lg ph-fw ph-lg" class="icon ph-dots-three-outline ph-bold ph-lg ph-fw ph-lg"
@ -111,13 +112,6 @@
<i class="icon ph-pencil ph-bold ph-lg ph-fw ph-lg"></i <i class="icon ph-pencil ph-bold ph-lg ph-fw ph-lg"></i
><span class="text">{{ i18n.ts.note }}</span> ><span class="text">{{ i18n.ts.note }}</span>
</button> </button>
<button
v-tooltip.noDelay.right="i18n.ts.help"
class="item _button help"
@click="openHelpMenu"
>
<i class="help icon ph-info ph-bold ph-xl ph-fw"></i>
</button>
</div> </div>
</div> </div>
</div> </div>
@ -135,7 +129,6 @@ import {
import * as os from "@/os"; import * as os from "@/os";
import { navbarItemDef } from "@/navbar"; import { navbarItemDef } from "@/navbar";
import { openAccountMenu as openAccountMenu_ } from "@/account"; import { openAccountMenu as openAccountMenu_ } from "@/account";
import { openHelpMenu_ } from "@/scripts/helpMenu";
import { defaultStore } from "@/store"; import { defaultStore } from "@/store";
import { i18n } from "@/i18n"; import { i18n } from "@/i18n";
@ -157,10 +150,6 @@ function openAccountMenu(ev: MouseEvent) {
); );
} }
function openHelpMenu(ev: MouseEvent) {
openHelpMenu_(ev);
}
function more() { function more() {
os.popup( os.popup(
defineAsyncComponent(() => import("@/components/MkLaunchPad.vue")), defineAsyncComponent(() => import("@/components/MkLaunchPad.vue")),

View File

@ -92,6 +92,7 @@
><i class="icon ph-door ph-bold ph-fw ph-lg"></i ><i class="icon ph-door ph-bold ph-fw ph-lg"></i
><span class="text">{{ i18n.ts.controlPanel }}</span> ><span class="text">{{ i18n.ts.controlPanel }}</span>
</MkA> </MkA>
<div class="divider" v-if="$i.isAdmin || $i.isModerator"></div>
<button <button
v-click-anime v-click-anime
v-tooltip.noDelay.right="i18n.ts.more" v-tooltip.noDelay.right="i18n.ts.more"
@ -127,13 +128,6 @@
<i class="icon ph-pencil ph-bold ph-fw ph-lg"></i <i class="icon ph-pencil ph-bold ph-fw ph-lg"></i
><span class="text">{{ i18n.ts.note }}</span> ><span class="text">{{ i18n.ts.note }}</span>
</button> </button>
<button
v-tooltip.noDelay.right="i18n.ts.help"
class="item _button help"
@click="openHelpMenu"
>
<i class="help icon ph-info ph-bold ph-xl ph-fw"></i>
</button>
<!-- <button v-click-anime v-tooltip.noDelay.right="$instance.name ?? i18n.ts.instance" class="item _button instance" @click="openInstanceMenu"> <!-- <button v-click-anime v-tooltip.noDelay.right="$instance.name ?? i18n.ts.instance" class="item _button instance" @click="openInstanceMenu">
<img :src="$instance.iconUrl || $instance.faviconUrl || '/favicon.ico'" alt="" class="icon"/> <img :src="$instance.iconUrl || $instance.faviconUrl || '/favicon.ico'" alt="" class="icon"/>
</button> --> </button> -->
@ -150,7 +144,6 @@ import { computed, defineAsyncComponent, ref, watch } from "vue";
import * as os from "@/os"; import * as os from "@/os";
import { navbarItemDef } from "@/navbar"; import { navbarItemDef } from "@/navbar";
import { $i, openAccountMenu as openAccountMenu_ } from "@/account"; import { $i, openAccountMenu as openAccountMenu_ } from "@/account";
import { openHelpMenu_ } from "@/scripts/helpMenu";
import { defaultStore } from "@/store"; import { defaultStore } from "@/store";
import { i18n } from "@/i18n"; import { i18n } from "@/i18n";
import { instance } from "@/instance"; import { instance } from "@/instance";
@ -221,10 +214,6 @@ function openAccountMenu(ev: MouseEvent) {
); );
} }
function openHelpMenu(ev: MouseEvent) {
openHelpMenu_(ev);
}
function more(ev: MouseEvent) { function more(ev: MouseEvent) {
os.popup( os.popup(
defineAsyncComponent(() => import("@/components/MkLaunchPad.vue")), defineAsyncComponent(() => import("@/components/MkLaunchPad.vue")),