Merge remote-tracking branch 'mi-dev/master' into report

This commit is contained in:
mattyatea 2023-12-28 04:16:03 +09:00
commit cb1586658e
No known key found for this signature in database
GPG key ID: 068E54E2C33BEF9A
567 changed files with 10281 additions and 3996 deletions

View file

@ -61,7 +61,7 @@ export async function getNoteClipMenu(props: {
},
);
},
})), null, {
})), { type: 'divider' }, {
icon: 'ti ti-plus',
text: i18n.ts.createNew,
action: async () => {
@ -94,7 +94,7 @@ export async function getNoteClipMenu(props: {
}];
}
export function getAbuseNoteMenu(note: misskey.entities.Note, text: string): MenuItem {
export function getAbuseNoteMenu(note: Misskey.entities.Note, text: string): MenuItem {
return {
icon: 'ti ti-exclamation-circle',
text,
@ -108,7 +108,7 @@ export function getAbuseNoteMenu(note: misskey.entities.Note, text: string): Men
};
}
export function getCopyNoteLinkMenu(note: misskey.entities.Note, text: string): MenuItem {
export function getCopyNoteLinkMenu(note: Misskey.entities.Note, text: string): MenuItem {
return {
icon: 'ti ti-link',
text,
@ -122,7 +122,7 @@ export function getCopyNoteLinkMenu(note: misskey.entities.Note, text: string):
export function getNoteMenu(props: {
note: Misskey.entities.Note;
menuButton: Ref<HTMLElement>;
translation: Ref<any>;
translation: Ref<Misskey.entities.NotesTranslateResponse | null>;
translating: Ref<boolean>;
isDeleted: Ref<boolean>;
currentClip?: Misskey.entities.Clip;
@ -264,7 +264,7 @@ export function getNoteMenu(props: {
text: i18n.ts.unclip,
danger: true,
action: unclip,
}, null] : []
}, { type: 'divider' }] : []
), {
icon: 'ti ti-info-circle',
text: i18n.ts.details,
@ -291,7 +291,7 @@ export function getNoteMenu(props: {
text: i18n.ts.translate,
action: translate,
} : undefined,
null,
{ type: 'divider' },
statePromise.then(state => state.isFavorited ? {
icon: 'ti ti-star-off',
text: i18n.ts.unfavorite,
@ -338,7 +338,7 @@ export function getNoteMenu(props: {
},
/*
...($i.isModerator || $i.isAdmin ? [
null,
{ type: 'divider' },
{
icon: 'ti ti-speakerphone',
text: i18n.ts.promote,
@ -347,13 +347,13 @@ export function getNoteMenu(props: {
: []
),*/
...(appearNote.userId !== $i.id ? [
null,
{ type: 'divider' },
appearNote.userId !== $i.id ? getAbuseNoteMenu(appearNote, i18n.ts.reportAbuse) : undefined,
]
: []
),
...(appearNote.userId === $i.id || $i.isModerator || $i.isAdmin ? [
null,
{ type: 'divider' },
appearNote.userId === $i.id ? {
icon: 'ti ti-edit',
text: i18n.ts.deleteAndEdit,
@ -389,7 +389,7 @@ export function getNoteMenu(props: {
}
if (noteActions.length > 0) {
menu = menu.concat([null, ...noteActions.map(action => ({
menu = menu.concat([{ type: "divider" }, ...noteActions.map(action => ({
icon: 'ti ti-plug',
text: action.title,
action: () => {
@ -399,7 +399,7 @@ export function getNoteMenu(props: {
}
if (defaultStore.state.devMode) {
menu = menu.concat([null, {
menu = menu.concat([{ type: "divider" }, {
icon: 'ti ti-id',
text: i18n.ts.copyNoteId,
action: () => {
@ -528,10 +528,9 @@ export function getRenoteMenu(props: {
}]);
}
// nullを挟むことで区切り線を出せる
const renoteItems = [
...normalRenoteItems,
...(channelRenoteItems.length > 0 && normalRenoteItems.length > 0) ? [null] : [],
...(channelRenoteItems.length > 0 && normalRenoteItems.length > 0) ? [{ type: 'divider' }] : [],
...channelRenoteItems,
];