From 0749f628b4b21080f295b61c9de62a5921772f31 Mon Sep 17 00:00:00 2001 From: "devin-ai-integration[bot]" <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Sun, 11 Aug 2024 08:08:46 +0000 Subject: [PATCH] Rename Event Attendance Verification to Event Attendance Proof --- components/EventAttendanceVerification.tsx | 36 +++++++++++----------- pages/index.tsx | 6 ++-- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/components/EventAttendanceVerification.tsx b/components/EventAttendanceVerification.tsx index 764289d69..df729f466 100644 --- a/components/EventAttendanceVerification.tsx +++ b/components/EventAttendanceVerification.tsx @@ -20,10 +20,10 @@ interface POAPEvent { // API_BASE_URL is no longer used, so we can remove this line entirely -const EventAttendanceVerification: React.FC<{ onVerified: () => void }> = ({ onVerified }) => { +const EventAttendanceProof: React.FC<{ onVerified: () => void }> = ({ onVerified }) => { const [inputAddress, setInputAddress] = useState(""); const [isVerifying, setIsVerifying] = useState(false); - const [verificationResult, setVerificationResult] = useState(null); + const [proofResult, setProofResult] = useState(null); const [poaps, setPOAPs] = useState([]); const [imageLoadErrors, setImageLoadErrors] = useState>({}); @@ -33,7 +33,7 @@ const EventAttendanceVerification: React.FC<{ onVerified: () => void }> = ({ onV const fetchPOAPs = useCallback(async (address: string) => { setIsVerifying(true); - setVerificationResult(null); + setProofResult(null); try { const response = await fetch(`/api/mockPoapApi?address=${address}`); if (!response.ok) { @@ -49,14 +49,14 @@ const EventAttendanceVerification: React.FC<{ onVerified: () => void }> = ({ onV ); setPOAPs(ethGlobalPOAPs); if (ethGlobalPOAPs.length === 0) { - setVerificationResult("No eligible POAPs found for ETHGlobal events in Brussels."); + setProofResult("No eligible POAPs found for ETHGlobal events in Brussels."); } } catch (error) { console.error("Error fetching POAPs:", error); if (error instanceof TypeError && error.message.includes("fetch")) { - setVerificationResult("Network error. Please check your internet connection and try again."); + setProofResult("Network error. Please check your internet connection and try again."); } else { - setVerificationResult(error instanceof Error ? error.message : "Failed to verify POAPs. Please try again."); + setProofResult(error instanceof Error ? error.message : "Failed to fetch POAPs. Please try again."); } } finally { setIsVerifying(false); @@ -71,14 +71,14 @@ const EventAttendanceVerification: React.FC<{ onVerified: () => void }> = ({ onV const handleVerify = useCallback(() => { if (poaps.length > 0) { - setVerificationResult(`Verification successful! ${inputAddress} has attended an ETHGlobal event in Brussels.`); + setProofResult(`Proof successful! ${inputAddress} has attended an ETHGlobal event in Brussels.`); onVerified(); } else { - setVerificationResult( - `Verification failed. No eligible POAPs found for ${inputAddress} at ETHGlobal events in Brussels.`, + setProofResult( + `Proof failed. No eligible POAPs found for ${inputAddress} at ETHGlobal events in Brussels.`, ); } - }, [poaps, inputAddress, onVerified]); + }, [poaps, inputAddress, onVerified, setProofResult]); const handleImageError = (tokenId: string) => { setImageLoadErrors(prev => ({ ...prev, [tokenId]: true })); @@ -86,9 +86,9 @@ const EventAttendanceVerification: React.FC<{ onVerified: () => void }> = ({ onV return (
-

Event Attendance Verification

+

Event Attendance Proof

- Enter your Ethereum address or ENS name to verify your attendance at an ETHGlobal event in Brussels: + Enter your Ethereum address or ENS name to provide proof of your attendance at an ETHGlobal event in Brussels:

void }> = ({ onV disabled={isVerifying || poaps.length === 0} className="bg-green-500 text-white p-2 rounded hover:bg-green-600 disabled:bg-gray-300 flex-1" > - Verify Attendance + Confirm Attendance
{isVerifying ? ( -

Verifying POAPs for {ensAddress || inputAddress}...

+

Fetching POAPs for {ensAddress || inputAddress}...

) : ( <> {poaps.length > 0 && ( @@ -145,13 +145,13 @@ const EventAttendanceVerification: React.FC<{ onVerified: () => void }> = ({ onV )} )} - {verificationResult && ( -

- {verificationResult} + {proofResult && ( +

+ {proofResult}

)} ); }; -export default EventAttendanceVerification; +export default EventAttendanceProof; diff --git a/pages/index.tsx b/pages/index.tsx index d76308c1d..1b98fd6c3 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -1,5 +1,5 @@ import React, { useEffect, useState } from "react"; -import EventAttendanceVerification from "../components/EventAttendanceVerification"; +import EventAttendanceProof from "../components/EventAttendanceVerification"; import IdentityVerification from "../components/IdentityVerification"; import OnchainAttestation from "../components/OnchainAttestation"; @@ -8,7 +8,7 @@ type Stage = (typeof stages)[number]; const stageDescriptions = { identity: "Verify your identity using ENS or Ethereum address", - attendance: "Confirm your attendance at ETHGlobal events", + attendance: "Confirm your attendance proof for ETHGlobal Brussels 2024", attestation: "Create an onchain attestation of your mission enrolment", complete: "Mission enrolment completed successfully", }; @@ -45,7 +45,7 @@ const Home: React.FC = () => { /> ); case "attendance": - return handleStageCompletion("attendance")} />; + return handleStageCompletion("attendance")} />; case "attestation": return handleStageCompletion("attestation")} />; case "complete":