diff options
| author | yupix <yupi0982@outlook.jp> | 2023-07-09 17:20:50 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-07-09 17:20:50 +0900 |
| commit | 9dd53527ca513f42c0ca9145e8122d898231f835 (patch) | |
| tree | 94976159ff3bd95a2fd81ea7d57cc1c2aebf3a52 /packages/frontend/src/scripts | |
| parent | refactor(locales, sw): use es module (#11204) (diff) | |
| download | sharkey-9dd53527ca513f42c0ca9145e8122d898231f835.tar.gz sharkey-9dd53527ca513f42c0ca9145e8122d898231f835.tar.bz2 sharkey-9dd53527ca513f42c0ca9145e8122d898231f835.zip | |
feat: プロフィールURLをコピー ボタンを追加 close #11190 (#11205)
Diffstat (limited to 'packages/frontend/src/scripts')
| -rw-r--r-- | packages/frontend/src/scripts/get-user-menu.ts | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/packages/frontend/src/scripts/get-user-menu.ts b/packages/frontend/src/scripts/get-user-menu.ts index c884ed76cb..636a6543d0 100644 --- a/packages/frontend/src/scripts/get-user-menu.ts +++ b/packages/frontend/src/scripts/get-user-menu.ts @@ -2,13 +2,14 @@ import { defineAsyncComponent } from 'vue'; import * as misskey from 'misskey-js'; import { i18n } from '@/i18n'; import copyToClipboard from '@/scripts/copy-to-clipboard'; -import { host } from '@/config'; +import { host, url } from '@/config'; import * as os from '@/os'; import { defaultStore, userActions } from '@/store'; import { $i, iAmModerator } from '@/account'; import { mainRouter } from '@/router'; import { Router } from '@/nirax'; import { rolesCache, userListsCache } from '@/cache'; +import { toUnicode } from 'punycode'; export function getUserMenu(user: misskey.entities.UserDetailed, router: Router = mainRouter) { const meId = $i ? $i.id : null; @@ -138,6 +139,13 @@ export function getUserMenu(user: misskey.entities.UserDetailed, router: Router copyToClipboard(`${user.host ?? host}/@${user.username}.atom`); }, }, { + icon: 'ti ti-share', + text: i18n.ts.copyProfileUrl, + action: () => { + const canonical = user.host === null ? `@${user.username}` : `@${user.username}@${toUnicode(user.host)}` + copyToClipboard(`${url}/${canonical}`); + }, + }, { icon: 'ti ti-mail', text: i18n.ts.sendMessage, action: () => { |