Skip to content

Commit ef62884

Browse files
committed
update attestation
1 parent a5fc19a commit ef62884

File tree

9 files changed

+98
-71
lines changed

9 files changed

+98
-71
lines changed

packages/grant-explorer/src/assets/preview_alt_3.svg

Lines changed: 55 additions & 55 deletions
Loading

packages/grant-explorer/src/features/attestations/MintProgressModalBody.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ export function MintProgressModalBodyHistory(
165165
impactImageCid={impactImageCid as string}
166166
attestationLink={attestationLink ?? ""}
167167
isShareButtonsAbove={false}
168-
imageSize="size-[288px] sm:size-[400px]"
168+
// imageSize="size-[288px] sm:size-[400px]"
169169
/>
170170
) : (
171171
<MintingProcessContent

packages/grant-explorer/src/features/attestations/MintYourImpactComponents.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ export const PreviewFrame = ({
3333
backgroundSize: "cover",
3434
backgroundPosition: "center",
3535
backgroundRepeat: "no-repeat",
36-
width: "400px",
37-
height: "400px",
36+
width: "690px",
37+
height: "344px",
3838
}}
3939
></div>
4040
<div className="flex flex-wrap gap-3 items-center mt-3 p-2">
@@ -142,7 +142,7 @@ import { ImageWithLoading } from "../common/components/ImageWithLoading";
142142
export const ImpactMintingSuccess = ({
143143
attestationLink,
144144
impactImageCid,
145-
imageSize = "size-[400px]",
145+
imageSize = "w-full max-w-[700px] relative",
146146
isShareButtonsAbove = true,
147147
}: {
148148
attestationLink: string;
Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,50 @@
1-
import React from "react";
1+
import React, { useEffect, useState } from "react";
22

33
export const ImageWithLoading = ({
44
src,
5-
sizeClass = "w-[400px] h-[400px]",
5+
sizeClass = "size-[400px]",
66
isLoading,
7+
style,
8+
onAspectRatioChange,
79
...props
810
}: {
911
src: string | undefined;
1012
sizeClass?: string;
1113
isLoading: boolean;
14+
style?: React.CSSProperties;
15+
onAspectRatioChange?: (ratio: string) => void;
1216
} & React.HTMLProps<HTMLDivElement>) => {
13-
// Handle loading and blur states
17+
const [aspectRatio, setAspectRatio] = useState("2/1");
1418
const loadingClass = isLoading ? "animate-pulse bg-gray-100" : "";
1519
const blurClass = !src ? "blur-[40px]" : "";
1620

21+
useEffect(() => {
22+
if (src) {
23+
const img = new Image();
24+
img.onload = () => {
25+
console.log("img.width", img.width);
26+
console.log("img.height", img.height);
27+
28+
const ratio = `${img.width}/${img.height}`;
29+
console.log("ratio", ratio);
30+
setAspectRatio(ratio);
31+
onAspectRatioChange?.(ratio);
32+
};
33+
img.src = src;
34+
}
35+
}, [src, onAspectRatioChange]);
36+
1737
return (
1838
<div
1939
{...props}
20-
className={`bg-cover bg-center bg-transparent ${sizeClass} ${blurClass} ${loadingClass}`}
21-
style={{ backgroundImage: `url("${src || ""}")` }} // Use src if available, otherwise keep it empty
40+
className={`bg-cover bg-center bg-no-repeat bg-transparent ${sizeClass} ${blurClass} ${loadingClass}`}
41+
style={{
42+
backgroundImage: `url("${src || ""}")`,
43+
aspectRatio,
44+
objectFit: "contain",
45+
height: "300px",
46+
...style,
47+
}}
2248
/>
2349
);
2450
};

packages/grant-explorer/src/features/contributors/components/ViewAttestationModal/ViewAttestationImage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export function ViewAttestationImage({
1919

2020
return (
2121
<ImageWithLoading
22-
sizeClass="w-full max-w-[400px] aspect-square relative"
22+
sizeClass="w-full max-w-[700px] relative"
2323
src={imageSrc}
2424
isLoading={isLoading}
2525
/>

packages/grant-explorer/src/features/contributors/components/ViewAttestationModal/ViewAttestationModal.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export function ViewAttestationModal({
3131

3232
return (
3333
<Modal isOpen={isOpen} onClose={onClose}>
34-
<div className="flex flex-col items-center gap-6 mx-auto w-full h-full overflow-x-auto max-w-full md:w-[625px]">
34+
<div className="flex flex-col items-center gap-6 mx-auto w-full h-full overflow-x-auto max-w-full md:w-[725px]">
3535
<h2 className="text-black text-3xl sm:text-4xl md:text-5xl/[52px] text-center font-medium font-sans text-[clamp(1.5rem, 2vw + 1rem, 2rem)]">
3636
{title}
3737
</h2>
@@ -40,7 +40,7 @@ export function ViewAttestationModal({
4040
onClick={() => window.open(transactionUrl, "_blank")}
4141
/>
4242
<ImageWithLoading
43-
sizeClass="w-full max-w-[400px] aspect-square relative"
43+
sizeClass={`w-full max-w-[700px] relative`}
4444
src={imageSrc}
4545
isLoading={isLoading}
4646
/>

packages/grant-explorer/src/features/round/ThankYou.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ export default function ThankYou() {
193193
<div className="w-full lg:w-1/2 ">
194194
<div className="flex flex-col items-center justify-center">
195195
{/* Main content */}
196-
<div className="w-full max-w-[800px] min-h-svh overflow-hidden bg-gradient-to-b from-[#EBEBEB] to-transparent rounded-t-[400px] flex flex-col items-center justify-center pt-20 px-4 mx-auto">
196+
<div className="w-full max-w-[900px] min-h-svh overflow-hidden bg-gradient-to-b from-[#EBEBEB] to-transparent rounded-t-[400px] flex flex-col items-center justify-center pt-20 px-4 mx-auto">
197197
<div className="flex flex-col items-center">
198198
<div className="relative max-w-[500px] z-10 text-center">
199199
<h1 className="text-5xl mb-2 font-modern-era-bold">
@@ -222,7 +222,7 @@ export default function ThankYou() {
222222
</div>
223223
</div>
224224
) : minted ? (
225-
<div className="rounded-xl absolute top-20 flex flex-col items-center text-center gap-6 px-[64px] py-8 backdrop-blur-xl">
225+
<div className="rounded-xl absolute top-20 flex flex-col items-center text-center gap-6 py-8 backdrop-blur-xl">
226226
<div className="flex flex-col gap-2">
227227
<div className="relative text-center font-modern-era-medium text-[48px]/[52px]">
228228
Your donation impact
@@ -235,7 +235,7 @@ export default function ThankYou() {
235235
</div>
236236
<ImpactMintingSuccess
237237
impactImageCid={impactImageCid}
238-
imageSize="size-[520px]"
238+
imageSize="w-full max-w-[700px]"
239239
attestationLink={attestationLink ?? ""}
240240
/>
241241
<div className="flex flex-wrap gap-6 my-2 z-50">

packages/grant-explorer/src/hooks/attestations/useEASAttestation.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ export const useEASAttestation = (
5959
updateStatus(ProgressStatus.IS_SUCCESS);
6060
return attestationLink;
6161
} catch (error) {
62+
console.error("Error in handleAttest", error);
6263
updateStatus(ProgressStatus.IS_ERROR);
6364
}
6465
};

packages/grant-explorer/src/hooks/attestations/useGetAttestationData.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export const useGetAttestationData = (
3030

3131
try {
3232
const response = await fetch(
33-
`https://attestation.gitcoin.co/api/getAttestation`,
33+
`https://gitcoin-server-api-git-card-update-grants-stack.vercel.app/api/getAttestation`,
3434
{
3535
method: "POST",
3636
headers: {

0 commit comments

Comments
 (0)