Merge pull request '[PR]: Improve the order of note menu items' (#10290) from naskya/calckey:chore/note-menu-order into develop
Reviewed-on: https://codeberg.org/calckey/calckey/pulls/10290
This commit is contained in:
commit
1186969ee6
|
@ -128,7 +128,7 @@
|
||||||
<button
|
<button
|
||||||
v-else-if="!item.hidden"
|
v-else-if="!item.hidden"
|
||||||
class="_button item"
|
class="_button item"
|
||||||
:class="{ danger: item.danger, active: item.active }"
|
:class="{ danger: item.danger, accent: item.accent, active: item.active }"
|
||||||
:disabled="item.active"
|
:disabled="item.active"
|
||||||
@click="clicked(item.action, $event)"
|
@click="clicked(item.action, $event)"
|
||||||
@mouseenter.passive="onItemMouseEnter(item)"
|
@mouseenter.passive="onItemMouseEnter(item)"
|
||||||
|
@ -398,6 +398,26 @@ onBeforeUnmount(() => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.accent {
|
||||||
|
color: var(--accent);
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
color: var(--accent);
|
||||||
|
|
||||||
|
&:before {
|
||||||
|
background: var(--accentedBg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&:active {
|
||||||
|
color: var(--fgOnAccent);
|
||||||
|
|
||||||
|
&:before {
|
||||||
|
background: var(--accent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
&.active {
|
&.active {
|
||||||
color: var(--fgOnAccent);
|
color: var(--fgOnAccent);
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
|
|
|
@ -262,13 +262,6 @@ export function getNoteMenu(props: {
|
||||||
null,
|
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",
|
icon: "ph-clipboard-text ph-bold ph-lg",
|
||||||
text: i18n.ts.copyContent,
|
text: i18n.ts.copyContent,
|
||||||
|
@ -372,10 +365,9 @@ export function getNoteMenu(props: {
|
||||||
}]
|
}]
|
||||||
: []
|
: []
|
||||||
),*/
|
),*/
|
||||||
...(!isAppearAuthor
|
|
||||||
? [
|
|
||||||
null,
|
null,
|
||||||
{
|
!isAppearAuthor
|
||||||
|
? {
|
||||||
icon: "ph-warning-circle ph-bold ph-lg",
|
icon: "ph-warning-circle ph-bold ph-lg",
|
||||||
text: i18n.ts.reportAbuse,
|
text: i18n.ts.reportAbuse,
|
||||||
action: () => {
|
action: () => {
|
||||||
|
@ -395,10 +387,23 @@ export function getNoteMenu(props: {
|
||||||
"closed",
|
"closed",
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
},
|
}
|
||||||
]
|
: undefined,
|
||||||
: []),
|
instance.features.postEditing && isAppearAuthor
|
||||||
|
? {
|
||||||
|
icon: "ph-pencil-line ph-bold ph-lg",
|
||||||
|
text: i18n.ts.edit,
|
||||||
|
accent: true,
|
||||||
|
action: edit,
|
||||||
|
}
|
||||||
|
: undefined,
|
||||||
|
isAppearAuthor
|
||||||
|
? {
|
||||||
|
icon: "ph-eraser ph-bold ph-lg",
|
||||||
|
text: i18n.ts.deleteAndEdit,
|
||||||
|
action: delEdit,
|
||||||
|
}
|
||||||
|
: undefined,
|
||||||
isAppearAuthor || isModerator
|
isAppearAuthor || isModerator
|
||||||
? {
|
? {
|
||||||
icon: "ph-trash ph-bold ph-lg",
|
icon: "ph-trash ph-bold ph-lg",
|
||||||
|
@ -407,14 +412,6 @@ export function getNoteMenu(props: {
|
||||||
action: del,
|
action: del,
|
||||||
}
|
}
|
||||||
: undefined,
|
: undefined,
|
||||||
|
|
||||||
isAppearAuthor
|
|
||||||
? {
|
|
||||||
icon: "ph-eraser ph-bold ph-lg",
|
|
||||||
text: i18n.ts.deleteAndEdit,
|
|
||||||
action: delEdit,
|
|
||||||
}
|
|
||||||
: undefined,
|
|
||||||
].filter((x) => x !== undefined);
|
].filter((x) => x !== undefined);
|
||||||
} else {
|
} else {
|
||||||
menu = [
|
menu = [
|
||||||
|
|
|
@ -51,6 +51,7 @@ export type MenuButton = {
|
||||||
icon?: string;
|
icon?: string;
|
||||||
indicate?: boolean;
|
indicate?: boolean;
|
||||||
danger?: boolean;
|
danger?: boolean;
|
||||||
|
accent?: boolean;
|
||||||
active?: boolean;
|
active?: boolean;
|
||||||
hidden?: boolean;
|
hidden?: boolean;
|
||||||
avatar?: Misskey.entities.User;
|
avatar?: Misskey.entities.User;
|
||||||
|
|
Loading…
Reference in New Issue