From be4a35bd6cca8c46abd8adebf71141a0bce08635 Mon Sep 17 00:00:00 2001 From: NoriDev Date: Thu, 18 May 2023 17:41:41 +0900 Subject: [PATCH] feat(friendly): Display the name of the current account in the account management popup --- CHANGELOG_CHERRYPICK.md | 1 + packages/frontend/src/account.ts | 24 ++++++++++++++++-------- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/CHANGELOG_CHERRYPICK.md b/CHANGELOG_CHERRYPICK.md index 7ecc889349..2148b83380 100644 --- a/CHANGELOG_CHERRYPICK.md +++ b/CHANGELOG_CHERRYPICK.md @@ -13,6 +13,7 @@ ### Improvements - 클라이언트: (friendly) 모바일에서 스크롤 시 각종 요소들의 유동적인 높이 조절을 변경된 헤더 디자인에 대응 - 클라이언트: (friendly) 모바일에서 하단 바를 길게 눌러 나오는 계정 관리 팝업에서 로그아웃 버튼 제거 +- 클라이언트: (friendly) 모바일에서 하단 바를 길게 눌러 나오는 계정 관리 팝업에서 현재 계정의 이름을 표시하도록 - 클라이언트: 채팅 및 그룹 기능 유지 (revert: [misskey-dev#9919](https://github.com/misskey-dev/misskey/pull/9919), [misskey-dev#9942](https://github.com/misskey-dev/misskey/pull/9942)) - 클라이언트: 클라이언트에서 사용되는 폰트의 확장자를 ttf에서 woff2 및 woff로 변경 ([@mk-castella](https://github.com/libnare/mk-castella/commit/f439b3e007618c02da7a352016b3d0f397311f54)) - 클라이언트: about-misskey 페이지에 CherryPick 관련 정보 추가 및 Misskey 문단 구분명 추가 diff --git a/packages/frontend/src/account.ts b/packages/frontend/src/account.ts index 9127e14ace..5bd95ac9f5 100644 --- a/packages/frontend/src/account.ts +++ b/packages/frontend/src/account.ts @@ -352,10 +352,18 @@ export async function openAccountMenu(opts: { align: 'left', }); } else if (opts.withExtraOperationFriendly) { + accountListFriendly($i); + } else { + popupMenu([...(opts.includeCurrentAccount ? [createItem($i)] : []), ...accountItemPromises], ev.currentTarget ?? ev.target, { + align: 'left', + }); + } + + function accountListFriendly (account: misskey.entities.UserDetailed) { popupMenu([...[{ type: 'link' as const, - text: i18n.ts.profile, - to: `/@${ $i.username }`, + text: account.name, + to: `/@${$i.username}`, avatar: $i, }, null, ...(opts.includeCurrentAccount ? [createItem($i)] : []), ...accountItemPromises, { type: 'parent' as const, @@ -363,10 +371,14 @@ export async function openAccountMenu(opts: { text: i18n.ts.addAccount, children: [{ text: i18n.ts.existingAccount, - action: () => { showSigninDialog(); }, + action: () => { + showSigninDialog(); + }, }, { text: i18n.ts.createAccount, - action: () => { createAccount(); }, + action: () => { + createAccount(); + }, }], }, { type: 'link' as const, @@ -376,9 +388,5 @@ export async function openAccountMenu(opts: { }]], ev.currentTarget ?? ev.target, { align: 'left', }); - } else { - popupMenu([...(opts.includeCurrentAccount ? [createItem($i)] : []), ...accountItemPromises], ev.currentTarget ?? ev.target, { - align: 'left', - }); } }