From 4ebf4dd1b079d5d727c5a6d615c7e39c72b5e8fa Mon Sep 17 00:00:00 2001 From: Michael Barrett Date: Wed, 15 Jan 2025 17:53:38 +0000 Subject: [PATCH] Fixed missing author handle in admin-x-activitypub (#22011) refs [AP-647](https://linear.app/ghost/issue/AP-648/refactor-profile-tab-to-use-account-and-follows) Fixed missing author handle in admin-x-activitypub --- apps/admin-x-activitypub/package.json | 2 +- apps/admin-x-activitypub/src/components/Profile.tsx | 9 ++++++--- .../src/components/global/APAvatar.tsx | 7 +++++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/apps/admin-x-activitypub/package.json b/apps/admin-x-activitypub/package.json index f1bf23f2b7..aa3768927b 100644 --- a/apps/admin-x-activitypub/package.json +++ b/apps/admin-x-activitypub/package.json @@ -1,6 +1,6 @@ { "name": "@tryghost/admin-x-activitypub", - "version": "0.3.45", + "version": "0.3.46", "license": "MIT", "repository": { "type": "git", diff --git a/apps/admin-x-activitypub/src/components/Profile.tsx b/apps/admin-x-activitypub/src/components/Profile.tsx index 541a16517b..ffa3f9ea9b 100644 --- a/apps/admin-x-activitypub/src/components/Profile.tsx +++ b/apps/admin-x-activitypub/src/components/Profile.tsx @@ -204,7 +204,8 @@ const FollowingTab: React.FC = () => { icon: { url: account.avatarUrl }, - name: account.name + name: account.name, + handle: account.handle }} />
@@ -245,7 +246,8 @@ const FollowersTab: React.FC = () => { icon: { url: account.avatarUrl }, - name: account.name + name: account.name, + handle: account.handle }} />
@@ -364,7 +366,8 @@ const Profile: React.FC = ({}) => { icon: { url: account?.avatarUrl }, - name: account?.name + name: account?.name, + handle: account?.handle }} size='lg' /> diff --git a/apps/admin-x-activitypub/src/components/global/APAvatar.tsx b/apps/admin-x-activitypub/src/components/global/APAvatar.tsx index 5319a75680..6f86771d7f 100644 --- a/apps/admin-x-activitypub/src/components/global/APAvatar.tsx +++ b/apps/admin-x-activitypub/src/components/global/APAvatar.tsx @@ -14,6 +14,7 @@ interface APAvatarProps { url: string; }; name: string; + handle?: string; } | undefined; size?: AvatarSize; } @@ -64,14 +65,16 @@ const APAvatar: React.FC = ({author, size}) => { containerClass = clsx(containerClass, 'bg-grey-100'); } + const handle = author?.handle || getUsername(author as ActorProperties); + const onClick = (e: React.MouseEvent) => { e.stopPropagation(); NiceModal.show(ViewProfileModal, { - profile: getUsername(author as ActorProperties) + profile: handle }); }; - const title = `${author?.name} ${getUsername(author as ActorProperties)}`; + const title = `${author?.name} ${handle}`; if (iconUrl) { return (