diff --git a/packages/data-layer/src/data-layer.ts b/packages/data-layer/src/data-layer.ts index 55e4d202b..9755c4a0f 100644 --- a/packages/data-layer/src/data-layer.ts +++ b/packages/data-layer/src/data-layer.ts @@ -1008,13 +1008,11 @@ export class DataLayer { }); } - async getAttestationCountByRecipientId({ - recipientId, + async getAttestationCount({ + attestationChainIds, }: { - recipientId: string; + attestationChainIds: number[] }): Promise { - return this.attestationService.getAttestationCountByRecipientId({ - recipientId, - }); + return this.attestationService.getAttestationCount({attestationChainIds}); } } diff --git a/packages/data-layer/src/services/AttestationService/AttestationService.ts b/packages/data-layer/src/services/AttestationService/AttestationService.ts index 394661fa4..05d455bc2 100644 --- a/packages/data-layer/src/services/AttestationService/AttestationService.ts +++ b/packages/data-layer/src/services/AttestationService/AttestationService.ts @@ -37,16 +37,18 @@ export class AttestationService { return response.attestationTxns; } - async getAttestationCountByRecipientId({ - recipientId, + async getAttestationCount({ + attestationChainIds }: { - recipientId: string; - }): Promise { + attestationChainIds: number[]; + }) : Promise { const query = gql` - query getAttestationCountByRecipientId( - $recipientId: String! + query getAttestationCount( + $attestationChainIds: [Int!]! ) { - attestations(filter: {recipient: { equalTo: $recipientId}}) { + attestations(filter: { + chainId: { in: $attestationChainIds } + }) { uid } } @@ -54,7 +56,7 @@ export class AttestationService { const response: { attestations: any[] } = await request(this.gsIndexerEndpoint, query, { - recipientId, + attestationChainIds, }); return response.attestations.length; diff --git a/packages/grant-explorer/src/features/attestations/MintYourImpactComponents.tsx b/packages/grant-explorer/src/features/attestations/MintYourImpactComponents.tsx index 6aeafa2dd..cf27a975b 100755 --- a/packages/grant-explorer/src/features/attestations/MintYourImpactComponents.tsx +++ b/packages/grant-explorer/src/features/attestations/MintYourImpactComponents.tsx @@ -217,7 +217,7 @@ export const PreviewFrame = ({ >
-
+
Pick your color
diff --git a/packages/grant-explorer/src/features/common/ShareButtons.tsx b/packages/grant-explorer/src/features/common/ShareButtons.tsx index a6d29371d..db31bc137 100755 --- a/packages/grant-explorer/src/features/common/ShareButtons.tsx +++ b/packages/grant-explorer/src/features/common/ShareButtons.tsx @@ -11,7 +11,7 @@ export const ShareButtons = (): JSX.Element => { return (
- Share + Share Your Impact
Frame diff --git a/packages/grant-explorer/src/features/contributors/hooks/useMintingAttestations.tsx b/packages/grant-explorer/src/features/contributors/hooks/useMintingAttestations.tsx index afd8345c4..33250140f 100644 --- a/packages/grant-explorer/src/features/contributors/hooks/useMintingAttestations.tsx +++ b/packages/grant-explorer/src/features/contributors/hooks/useMintingAttestations.tsx @@ -3,7 +3,7 @@ import { useMemo } from "react"; import { useAccount } from "wagmi"; import { MintingAttestationIdsData, useDataLayer } from "data-layer"; import { useQuery, UseQueryResult } from "@tanstack/react-query"; -import { AttestationFee, FeeExemptAttestationsLimit } from "../../attestations/utils/constants"; +import { AttestationChainId, AttestationFee, FeeExemptAttestationsLimit } from "../../attestations/utils/constants"; export type MintingAttestationsResponse = Omit< UseQueryResult, @@ -58,14 +58,13 @@ export const useMintingAttestations = ( export const useAttestationFee = () => { - const { address } = useAccount(); const dataLayer = useDataLayer(); const exisitingAttestations = useQuery({ - queryKey :[address], + queryKey :[], queryFn: async () => { - const response = await dataLayer.getAttestationCountByRecipientId({ - recipientId: address!.toLowerCase(), + const response = await dataLayer.getAttestationCount({ + attestationChainIds: [AttestationChainId] }); return response; }, @@ -73,7 +72,6 @@ export const useAttestationFee = () => { const fee = useMemo(() => { if ( - !address || !exisitingAttestations.data || exisitingAttestations.data >= FeeExemptAttestationsLimit ) return AttestationFee;