Skip to content

Commit

Permalink
Merge pull request #35 from daqhris/rename-enrolment-to-enrollment
Browse files Browse the repository at this point in the history
Fix GitHub error logs
  • Loading branch information
daqhris authored Aug 11, 2024
2 parents 96400af + 3bbdecf commit 6e26e83
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 14 deletions.
22 changes: 19 additions & 3 deletions components/IdentityVerification.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,25 @@ const IdentityVerification: React.FC<{ onVerified: (address: string) => void }>
/>
{isLoading && (
<span className="absolute right-3 top-2 text-blue-500">
<svg className="animate-spin h-5 w-5" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
<circle className="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" strokeWidth="4"></circle>
<path className="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
<svg
className="animate-spin h-5 w-5"
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
>
<circle
className="opacity-25"
cx="12"
cy="12"
r="10"
stroke="currentColor"
strokeWidth="4"
></circle>
<path
className="opacity-75"
fill="currentColor"
d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
></path>
</svg>
</span>
)}
Expand Down
22 changes: 11 additions & 11 deletions pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const Home: React.FC = () => {
}, [completedStages, currentStage, setCurrentStage]);

const handleStageCompletion = (stage: Stage) => {
setCompletedStages((prev) => [...prev, stage]);
const newCompletedStages = [...completedStages, stage];
setCompletedStages(newCompletedStages);
localStorage.setItem('completedStages', JSON.stringify(newCompletedStages));
Expand All @@ -57,20 +58,18 @@ const Home: React.FC = () => {
return <IdentityVerification onVerified={() => handleStageCompletion("identity")} />;
case "attendance":
return (
<EventAttendanceVerification
onVerified={() => {
// We'll handle setting POAPs in the component itself
handleStageCompletion("attendance");
}}
/>
<div className="p-4 bg-white shadow rounded-lg">
<h2 className="text-2xl font-bold mb-4">Event Attendance Proof</h2>
<p>Event attendance proof functionality is currently unavailable.</p>
</div>
);
case "attestation":
return <OnchainAttestation onAttestationComplete={() => handleStageCompletion("attestation")} poaps={poaps} />;
case "complete":
return (
<div className="p-4 bg-white shadow rounded-lg">
<h2 className="text-2xl font-bold mb-4">Mission Enrolment Complete!</h2>
<p>Congratulations! You have successfully completed all stages of the mission enrolment.</p>
<h2 className="text-2xl font-bold mb-4">Mission Enrollment Complete!</h2>
<p>Congratulations! You have successfully completed all stages of the mission enrollment.</p>
</div>
);
default:
Expand All @@ -86,8 +85,9 @@ const Home: React.FC = () => {
Current Stage: {currentStage.charAt(0).toUpperCase() + currentStage.slice(1)}
</h2>
<p className="text-lg">{stageDescriptions[currentStage]}</p>
<p className="mt-2 text-sm text-blue-700">Complete this stage to proceed to the next step of your mission enrollment.</p>

<p className="mt-2 text-sm text-blue-700">
Complete this stage to proceed to the next step of your mission enrollment.
</p>
</div>
{renderCurrentStage()}
<div className="mt-8">
Expand All @@ -96,7 +96,7 @@ const Home: React.FC = () => {
<div
className="bg-blue-600 h-4 rounded-full transition-all duration-500 ease-in-out"
style={{ width: `${(completedStages.length / stages.length) * 100}%` }}
></div>
/>
</div>
<ul className="space-y-4">
{stages.map((stage, index) => (
Expand Down

0 comments on commit 6e26e83

Please sign in to comment.