Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: identicons URL #903

Merged
merged 1 commit into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/domains/externalDomainCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const ExternalDomainCard: FunctionComponent<ExternalDomainCardProps> = ({
? "/braavos/braavosLogoWithBackground.webp"
: domainKind === "sol"
? "/solana/bonfida.webp"
: `${process.env.NEXT_PUBLIC_STARKNET_ID}/api/identicons/0`
: `https://identicon.starknet.id/0`
Marchand-Nicolas marked this conversation as resolved.
Show resolved Hide resolved
}
height={150}
width={150}
Expand Down
2 changes: 1 addition & 1 deletion components/domains/selectIdentity.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const SelectIdentity: FunctionComponent<SelectIdentityProps> = ({
<ListItemIcon>
<img
width={"25px"}
src={`${process.env.NEXT_PUBLIC_STARKNET_ID}/api/identicons/${tokenId}`}
src={`https://identicon.starknet.id/${tokenId}`}
alt="starknet.id avatar"
/>
</ListItemIcon>
Expand Down
2 changes: 1 addition & 1 deletion components/identities/identitiesGalleryV1.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ const IdentitiesGalleryV1: FunctionComponent<IdentitiesGalleryV1Props> = ({
<img
width={150}
height={150}
src={`${process.env.NEXT_PUBLIC_STARKNET_ID}/api/identicons/0`}
src="https://identicon.starknet.id/0"
alt="avatar"
onClick={() => router.push(`/externaldomains/${domain}`)}
/>
Expand Down
2 changes: 1 addition & 1 deletion tests/utils/userDataService.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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" };
Expand Down
4 changes: 1 addition & 3 deletions utils/apiWrappers/identity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,7 @@ export class Identity {
}

async getPfpFromVerifierData(): Promise<string> {
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),
Expand Down
3 changes: 1 addition & 2 deletions utils/userDataService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`;
};
Marchand-Nicolas marked this conversation as resolved.
Show resolved Hide resolved