From 37d5d98710c174efabeeb07411696d24c068d2d8 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 aaec3099d..7b98799e5 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 81647316bc2757e7b6913db9748584feacf4375b 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 455552774..978db091a 100644 --- a/packages/client/src/components/MkMenu.vue +++ b/packages/client/src/components/MkMenu.vue @@ -128,7 +128,7 @@