summaryrefslogtreecommitdiff
path: root/packages/frontend/src/ui/_common_/common.ts
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2022-12-28 13:29:42 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2022-12-28 13:29:42 +0900
commit0be42fc3a93b8bc0eff7526f522b125eabc00d56 (patch)
tree3cb0d84e2510cd59b150fbedb52a30d2ebf8fae6 /packages/frontend/src/ui/_common_/common.ts
parenttweak ui (diff)
downloadmisskey-0be42fc3a93b8bc0eff7526f522b125eabc00d56.tar.gz
misskey-0be42fc3a93b8bc0eff7526f522b125eabc00d56.tar.bz2
misskey-0be42fc3a93b8bc0eff7526f522b125eabc00d56.zip
refactor
Diffstat (limited to 'packages/frontend/src/ui/_common_/common.ts')
-rw-r--r--packages/frontend/src/ui/_common_/common.ts63
1 files changed, 63 insertions, 0 deletions
diff --git a/packages/frontend/src/ui/_common_/common.ts b/packages/frontend/src/ui/_common_/common.ts
new file mode 100644
index 0000000000..10c9b66d47
--- /dev/null
+++ b/packages/frontend/src/ui/_common_/common.ts
@@ -0,0 +1,63 @@
+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,
+ icon: 'ti ti-mood-happy',
+ 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',
+ text: i18n.ts.help,
+ icon: 'ti ti-question-circle',
+ children: [{
+ type: 'link',
+ to: '/mfm-cheat-sheet',
+ text: i18n.ts._mfm.cheatSheet,
+ icon: 'ti ti-code',
+ }, {
+ 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',
+ }, null, {
+ text: i18n.ts.document,
+ icon: 'ti ti-question-circle',
+ action: () => {
+ window.open('https://misskey-hub.net/help.html', '_blank');
+ },
+ }],
+ }, {
+ type: 'link',
+ text: i18n.ts.aboutMisskey,
+ to: '/about-misskey',
+ }], ev.currentTarget ?? ev.target, {
+ align: 'left',
+ });
+}