diff --git a/src/lib/components/UserCard.stories.tsx b/src/lib/components/UserCard.stories.tsx index eda293d..46433a4 100644 --- a/src/lib/components/UserCard.stories.tsx +++ b/src/lib/components/UserCard.stories.tsx @@ -27,12 +27,16 @@ const demoUser: Props["user"] = { Twitter: twitter.com/KawamataRyo GitHub: github.com/kawamataryo Zenn: zenn.dev/ryo_kawamata`, - avatar: "https://avatar.iran.liara.run/public", + avatar: "https://i.pravatar.cc/150?u=123", matchType: BSKY_USER_MATCH_TYPE.HANDLE, isFollowing: false, followingUri: "", isBlocking: false, blockingUri: "", + originalAvatar: "https://i.pravatar.cc/150?u=123", + originalHandle: "kawamataryo", + originalDisplayName: "KawamataRyo", + originalProfileLink: "https://x.com/kawamataryo", }; const mockAction: Props["clickAction"] = async () => { diff --git a/src/lib/components/UserCard.tsx b/src/lib/components/UserCard.tsx index 331193d..f4f65c3 100644 --- a/src/lib/components/UserCard.tsx +++ b/src/lib/components/UserCard.tsx @@ -4,6 +4,74 @@ import type { BskyUser } from "~types"; import { ACTION_MODE, MATCH_TYPE_LABEL_AND_COLOR } from "../constants"; import AvatarFallbackSvg from "./Icons/AvatarFallbackSvg"; +type UserProfileProps = { + avatar: string; + url: string; +}; + +const UserProfile = ({ avatar, url }: UserProfileProps) => ( +
+ + @{handle} + +
+{user.description}
diff --git a/src/lib/hooks/useRetrieveBskyUsers.ts b/src/lib/hooks/useRetrieveBskyUsers.ts index e7c248b..d73e223 100644 --- a/src/lib/hooks/useRetrieveBskyUsers.ts +++ b/src/lib/hooks/useRetrieveBskyUsers.ts @@ -70,6 +70,10 @@ export const useRetrieveBskyUsers = () => { followingUri: searchResult.bskyProfile.viewer?.following, isBlocking: !!searchResult.bskyProfile.viewer?.blocking, blockingUri: searchResult.bskyProfile.viewer?.blocking, + originalAvatar: userData.originalAvatar, + originalHandle: userData.accountName, + originalDisplayName: userData.displayName, + originalProfileLink: userData.originalProfileLink, }, ]; }); diff --git a/src/lib/services/xService.ts b/src/lib/services/xService.ts index cb0e607..085f013 100644 --- a/src/lib/services/xService.ts +++ b/src/lib/services/xService.ts @@ -20,6 +20,10 @@ export class XService extends AbstractService { ?.match(/bsky\.app\/profile\/([^/\s]+)…?/)?.[1] ?.replace("…", "") ?? ""; + const originalAvatar = userCell + .querySelector('[data-testid^="UserAvatar-Container"]') + ?.querySelector("img") + ?.getAttribute("src"); return { accountName, @@ -27,6 +31,8 @@ export class XService extends AbstractService { accountNameRemoveUnderscore, accountNameReplaceUnderscore, bskyHandle, + originalAvatar, + originalProfileLink: `https://x.com/${accountName}`, }; } diff --git a/src/options.tsx b/src/options.tsx index cb4e13e..ccb559e 100644 --- a/src/options.tsx +++ b/src/options.tsx @@ -48,19 +48,21 @@ const Option = () => { matchTypeStats={matchTypeStats} />