From 88f5cc416ef413d42b5ad8a1d70be7f874929a00 Mon Sep 17 00:00:00 2001 From: Freeplay Date: Wed, 14 Jun 2023 18:33:13 -0400 Subject: [PATCH] Use help menu in Kanban --- packages/client/src/scripts/helpMenu.ts | 16 ++++++++++++---- packages/client/src/ui/visitor/kanban.vue | 19 ++----------------- 2 files changed, 14 insertions(+), 21 deletions(-) diff --git a/packages/client/src/scripts/helpMenu.ts b/packages/client/src/scripts/helpMenu.ts index 7e33c220b4..7d08393f84 100644 --- a/packages/client/src/scripts/helpMenu.ts +++ b/packages/client/src/scripts/helpMenu.ts @@ -4,6 +4,8 @@ import { host } from "@/config"; import * as os from "@/os"; import XTutorial from "../components/MkTutorialDialog.vue"; import { i18n } from "@/i18n"; +import { $i } from "@/account"; + export function openHelpMenu_(ev: MouseEvent) { os.popupMenu( @@ -40,7 +42,13 @@ export function openHelpMenu_(ev: MouseEvent) { window.open("https://calckey.org/apps", "_blank"); }, }, - { + $i ? null : { + type: "link", + text: i18n.ts._mfm.cheatSheet, + icon: "ph-question ph-bold ph-lg", + to: "/mfm-cheat-sheet", + }, + $i ? { type: "button", action: async () => { defaultStore.set("tutorial", 0); @@ -48,19 +56,19 @@ export function openHelpMenu_(ev: MouseEvent) { }, text: i18n.ts.replayTutorial, icon: "ph-circle-wavy-question ph-bold ph-lg", - }, + } : undefined, null, { type: "parent", text: i18n.ts.developer, icon: "ph-code ph-bold ph-lg", children: [ - { + $i ? { type: "link", to: "/api-console", text: "API Console", icon: "ph-terminal-window ph-bold ph-lg", - }, + } : undefined, { text: i18n.ts.document, icon: "ph-file-doc ph-bold ph-lg", diff --git a/packages/client/src/ui/visitor/kanban.vue b/packages/client/src/ui/visitor/kanban.vue index 962f937ebd..f7460bbfd7 100644 --- a/packages/client/src/ui/visitor/kanban.vue +++ b/packages/client/src/ui/visitor/kanban.vue @@ -177,6 +177,7 @@ import FormLink from "@/components/form/link.vue"; import XShowMoreButton from "@/components/MkShowMoreButton.vue"; import { i18n } from "@/i18n"; import { DetailedInstanceMetadata } from "calckey-js/built/entities"; +import { openHelpMenu_ } from "@/scripts/helpMenu"; import XSigninDialog from "@/components/MkSigninDialog.vue"; import XSignupDialog from "@/components/MkSignupDialog.vue"; import MkKeyValue from "@/components/MkKeyValue.vue"; @@ -231,23 +232,7 @@ function signup() { ); }; function showMenu(ev) { - os.popupMenu( - [ - { - type: "link", - text: i18n.ts.instanceInfo, - icon: "ph-info ph-bold ph-lg", - to: "/about" - }, - { - type: "link", - text: i18n.ts.aboutMisskey, - icon: "ph-info ph-bold ph-lg", - to: "/about-calckey" - }, - ], - ev.currentTarget ?? ev.target - ); + openHelpMenu_(ev); }