From 91190244fb851a230e8d7d972ab4ff8db09beee7 Mon Sep 17 00:00:00 2001 From: naskya Date: Thu, 8 Jun 2023 19:02:50 +0900 Subject: [PATCH 1/2] change note menu order --- packages/client/src/scripts/get-note-menu.ts | 78 ++++++++++---------- 1 file changed, 37 insertions(+), 41 deletions(-) diff --git a/packages/client/src/scripts/get-note-menu.ts b/packages/client/src/scripts/get-note-menu.ts index aaec3099d2..7b98799e5f 100644 --- a/packages/client/src/scripts/get-note-menu.ts +++ b/packages/client/src/scripts/get-note-menu.ts @@ -262,13 +262,6 @@ export function getNoteMenu(props: { null, ] : []), - instance.features.postEditing && isAppearAuthor - ? { - icon: "ph-pencil-line ph-bold ph-lg", - text: i18n.ts.edit, - action: edit, - } - : undefined, { icon: "ph-clipboard-text ph-bold ph-lg", text: i18n.ts.copyContent, @@ -372,33 +365,44 @@ export function getNoteMenu(props: { }] : [] ),*/ - ...(!isAppearAuthor - ? [ - null, - { - icon: "ph-warning-circle ph-bold ph-lg", - text: i18n.ts.reportAbuse, - action: () => { - const u = - appearNote.url || - appearNote.uri || - `${url}/notes/${appearNote.id}`; - os.popup( - defineAsyncComponent( - () => import("@/components/MkAbuseReportWindow.vue"), - ), - { - user: appearNote.user, - initialComment: `Note: ${u}\n-----\n`, - }, - {}, - "closed", - ); - }, + null, + !isAppearAuthor + ? { + icon: "ph-warning-circle ph-bold ph-lg", + text: i18n.ts.reportAbuse, + action: () => { + const u = + appearNote.url || + appearNote.uri || + `${url}/notes/${appearNote.id}`; + os.popup( + defineAsyncComponent( + () => import("@/components/MkAbuseReportWindow.vue"), + ), + { + user: appearNote.user, + initialComment: `Note: ${u}\n-----\n`, + }, + {}, + "closed", + ); }, - ] - : []), - + } + : undefined, + instance.features.postEditing && isAppearAuthor + ? { + icon: "ph-pencil-line ph-bold ph-lg", + text: i18n.ts.edit, + action: edit, + } + : undefined, + isAppearAuthor + ? { + icon: "ph-eraser ph-bold ph-lg", + text: i18n.ts.deleteAndEdit, + action: delEdit, + } + : undefined, isAppearAuthor || isModerator ? { icon: "ph-trash ph-bold ph-lg", @@ -407,14 +411,6 @@ export function getNoteMenu(props: { action: del, } : undefined, - - isAppearAuthor - ? { - icon: "ph-eraser ph-bold ph-lg", - text: i18n.ts.deleteAndEdit, - action: delEdit, - } - : undefined, ].filter((x) => x !== undefined); } else { menu = [ From db37f2f8e07b63f8cc0b564f49006a34b645ffee Mon Sep 17 00:00:00 2001 From: naskya Date: Thu, 8 Jun 2023 17:47:21 +0000 Subject: [PATCH 2/2] change style --- packages/client/src/components/MkMenu.vue | 22 +++++++++++++++++++- packages/client/src/scripts/get-note-menu.ts | 1 + packages/client/src/types/menu.ts | 1 + 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/packages/client/src/components/MkMenu.vue b/packages/client/src/components/MkMenu.vue index 4555527747..978db091a0 100644 --- a/packages/client/src/components/MkMenu.vue +++ b/packages/client/src/components/MkMenu.vue @@ -128,7 +128,7 @@