yumechi-no-kuni/packages/frontend/src/ui/_common_/common.ts

64 lines
1.3 KiB
TypeScript
Raw Normal View History

2022-12-27 22:29:42 -06:00
import * as os from '@/os';
import { instance } from '@/instance';
import { host } from '@/config';
import { i18n } from '@/i18n';
export function openInstanceMenu(ev: MouseEvent) {
os.popupMenu([{
text: instance.name ?? host,
type: 'label',
}, {
type: 'link',
text: i18n.ts.instanceInfo,
icon: 'ti ti-info-circle',
to: '/about',
}, {
type: 'link',
text: i18n.ts.customEmojis,
2022-12-31 05:36:49 -06:00
icon: 'ti ti-icons',
2022-12-27 22:29:42 -06:00
to: '/about#emojis',
}, {
type: 'link',
text: i18n.ts.federation,
icon: 'ti ti-whirl',
to: '/about#federation',
}, {
type: 'link',
text: i18n.ts.charts,
icon: 'ti ti-chart-line',
to: '/about#charts',
}, null, {
type: 'parent',
2022-12-27 22:34:47 -06:00
text: i18n.ts.tools,
icon: 'ti ti-tool',
2022-12-27 22:29:42 -06:00
children: [{
type: 'link',
to: '/scratchpad',
text: i18n.ts.scratchpad,
icon: 'ti ti-terminal-2',
}, {
type: 'link',
to: '/api-console',
text: 'API Console',
icon: 'ti ti-terminal-2',
2023-01-08 02:41:09 -06:00
}, {
type: 'link',
to: '/clicker',
text: '🍪👈',
icon: 'ti ti-cookie',
2022-12-27 22:34:47 -06:00
}],
}, null, {
text: i18n.ts.help,
icon: 'ti ti-question-circle',
2023-01-08 22:39:16 -06:00
action: () => {
window.open('https://misskey-hub.net/help.html', '_blank');
},
2022-12-27 22:29:42 -06:00
}, {
type: 'link',
text: i18n.ts.aboutMisskey,
to: '/about-misskey',
}], ev.currentTarget ?? ev.target, {
align: 'left',
});
}