Skip to content

Commit

Permalink
Fix for profile pic image url
Browse files Browse the repository at this point in the history
  • Loading branch information
dankelleher committed Jan 20, 2025
1 parent b3d2df6 commit 5272954
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions components/Profile/ProfileImage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const ProfileImage: FC<Props> = ({ publicKey, expanded, className }) => {
]
const classes = classNames(commonClasses, className || profilePopupClasses)

const { profile, loading } = useProfile(publicKey)
const { profile, loading, url } = useProfile(publicKey)

// Profile loading - show loading dots
if (!profile && loading) return <LoadingDots />
Expand All @@ -41,7 +41,7 @@ export const ProfileImage: FC<Props> = ({ publicKey, expanded, className }) => {
<a
className="underline"
target="_blank"
href={'https://civic.me/' + publicKey?.toString()}
href={url}
rel="noreferrer"
>
<ImgWithLoader
Expand Down
6 changes: 4 additions & 2 deletions components/Profile/useProfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const profileIsSet = (profile: BaseProfile): boolean =>

export const useProfile = (
publicKey?: PublicKey
): { profile: Profile | undefined; loading: boolean } => {
): { profile: Profile | undefined; loading: boolean, url: string } => {
const connection = useLegacyConnectionContext()
const connectedWallet = useWalletOnePointOh()

Expand All @@ -35,5 +35,7 @@ export const useProfile = (
}
)

return { profile, loading: isLoading }
const url = 'https://civic.me/' + profileWalletPublicKey?.toString()

return { profile, loading: isLoading, url }
}

0 comments on commit 5272954

Please sign in to comment.