diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2023-12-12 10:26:37 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2023-12-12 10:26:37 +0900 |
| commit | b691126bff96aa9a15e0b66381ea734e34ef4531 (patch) | |
| tree | 3428f80cffd2cd60ea9a3567e22d8f35cf87f7e6 /packages/frontend/src/scripts/get-note-menu.ts | |
| parent | Fix trailing commas (#12628) (diff) | |
| download | misskey-b691126bff96aa9a15e0b66381ea734e34ef4531.tar.gz misskey-b691126bff96aa9a15e0b66381ea734e34ef4531.tar.bz2 misskey-b691126bff96aa9a15e0b66381ea734e34ef4531.zip | |
refactor(frontend): menuのdividerをnullで表現するのをやめる
Diffstat (limited to 'packages/frontend/src/scripts/get-note-menu.ts')
| -rw-r--r-- | packages/frontend/src/scripts/get-note-menu.ts | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/packages/frontend/src/scripts/get-note-menu.ts b/packages/frontend/src/scripts/get-note-menu.ts index 14ada9b7f0..1f6cfffce1 100644 --- a/packages/frontend/src/scripts/get-note-menu.ts +++ b/packages/frontend/src/scripts/get-note-menu.ts @@ -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, @@ -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, @@ -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, ]; |