From f446b8d7c40863ad6f61e1546bf02e79895d4ba6 Mon Sep 17 00:00:00 2001 From: Fricoben Date: Mon, 28 Oct 2024 09:18:54 +0000 Subject: [PATCH] fix: identicons URL --- components/domains/externalDomainCard.tsx | 2 +- components/domains/selectIdentity.tsx | 2 +- components/identities/identitiesGalleryV1.tsx | 2 +- tests/utils/userDataService.test.js | 2 +- utils/apiWrappers/identity.ts | 4 +--- utils/userDataService.ts | 3 +-- 6 files changed, 6 insertions(+), 9 deletions(-) diff --git a/components/domains/externalDomainCard.tsx b/components/domains/externalDomainCard.tsx index 334175c4..97810cf8 100644 --- a/components/domains/externalDomainCard.tsx +++ b/components/domains/externalDomainCard.tsx @@ -35,7 +35,7 @@ const ExternalDomainCard: FunctionComponent = ({ ? "/braavos/braavosLogoWithBackground.webp" : domainKind === "sol" ? "/solana/bonfida.webp" - : `${process.env.NEXT_PUBLIC_STARKNET_ID}/api/identicons/0` + : `https://identicon.starknet.id/0` } height={150} width={150} diff --git a/components/domains/selectIdentity.tsx b/components/domains/selectIdentity.tsx index 9c2b07f6..99ecd14d 100644 --- a/components/domains/selectIdentity.tsx +++ b/components/domains/selectIdentity.tsx @@ -87,7 +87,7 @@ const SelectIdentity: FunctionComponent = ({ starknet.id avatar diff --git a/components/identities/identitiesGalleryV1.tsx b/components/identities/identitiesGalleryV1.tsx index 50c312c3..7eab56c5 100644 --- a/components/identities/identitiesGalleryV1.tsx +++ b/components/identities/identitiesGalleryV1.tsx @@ -154,7 +154,7 @@ const IdentitiesGalleryV1: FunctionComponent = ({ avatar router.push(`/externaldomains/${domain}`)} /> diff --git a/tests/utils/userDataService.test.js b/tests/utils/userDataService.test.js index 407b272b..fff02fd1 100644 --- a/tests/utils/userDataService.test.js +++ b/tests/utils/userDataService.test.js @@ -83,7 +83,7 @@ describe("computeMetadataHash function", () => { }); describe("getPfpFromFullId function", () => { - const defaultUrl = `${STARKNET_ID_URL}/api/identicons/`; + const defaultUrl = `https://identicon.starknet.id/`; it("should return the image URL if pp_url is present", () => { const identity = { id: "123", pp_url: "http://example.com/profile.jpg" }; diff --git a/utils/apiWrappers/identity.ts b/utils/apiWrappers/identity.ts index 06fa7bbe..92890af6 100644 --- a/utils/apiWrappers/identity.ts +++ b/utils/apiWrappers/identity.ts @@ -167,9 +167,7 @@ export class Identity { } async getPfpFromVerifierData(): Promise { - const identiconsUrl = `${ - process.env.NEXT_PUBLIC_STARKNET_ID - }/api/identicons/${Number(this.id)}`; + const identiconsUrl = `https://identicon.starknet.id/${Number(this.id)}`; // Get NFT contract address from verifier_data const contractAddress = this.getVerifierData( formatHexString(process.env.NEXT_PUBLIC_NFT_PP_VERIFIER as string), diff --git a/utils/userDataService.ts b/utils/userDataService.ts index b5691905..8ad89831 100644 --- a/utils/userDataService.ts +++ b/utils/userDataService.ts @@ -33,6 +33,5 @@ export async function computeMetadataHash( export const getPfpFromFullId = (identity: FullId): string => { if (identity && identity.pp_url) return getImgUrl(identity.pp_url); - else - return `${process.env.NEXT_PUBLIC_STARKNET_ID}/api/identicons/${identity.id}`; + else return `https://identicon.starknet.id/${identity.id}`; };