upd: add ability to open remote profile in user dropdown

Closes transfem-org/Sharkey#176
This commit is contained in:
Mar0xy 2023-11-27 22:17:03 +01:00
parent 3d0b754332
commit 958b97a50c
No known key found for this signature in database
GPG key ID: 56569BBE47D2C828
4 changed files with 10 additions and 1 deletions

View file

@ -55,6 +55,7 @@ addToAntenna: "Add to antenna"
sendMessage: "Send a message"
copyRSS: "Copy RSS"
copyUsername: "Copy username"
openRemoteProfile: "Open remote profile"
copyUserId: "Copy user ID"
copyNoteId: "Copy note ID"
copyFileId: "Copy file ID"

1
locales/index.d.ts vendored
View file

@ -58,6 +58,7 @@ export interface Locale {
"sendMessage": string;
"copyRSS": string;
"copyUsername": string;
"openRemoteProfile": string;
"copyUserId": string;
"copyNoteId": string;
"copyFileId": string;

View file

@ -55,6 +55,7 @@ addToAntenna: "アンテナに追加"
sendMessage: "メッセージを送信"
copyRSS: "RSSをコピー"
copyUsername: "ユーザー名をコピー"
openRemoteProfile: "リモートプロファイルを開く"
copyUserId: "ユーザーIDをコピー"
copyNoteId: "ートIDをコピー"
copyFileId: "ファイルIDをコピー"

View file

@ -176,7 +176,13 @@ export function getUserMenu(user: Misskey.entities.UserDetailed, router: Router
const canonical = user.host === null ? `@${user.username}` : `@${user.username}@${toUnicode(user.host)}`;
copyToClipboard(`${url}/${canonical}`);
},
}, {
}, ...(user.host ? [{
icon: 'ph-share ph-bold ph-lg',
text: i18n.ts.openRemoteProfile,
action: () => {
open(`${user.uri}`, '_blank');
},
}] : []), {
icon: 'ph-envelope ph-bold ph-lg',
text: i18n.ts.sendMessage,
action: () => {