Skip to content

Commit 513c718

Browse files
authored
Merge pull request #22 from big14way/feature/checked-in-counter
feat: implement checked-in builders counter display
2 parents 238f138 + 9d234d5 commit 513c718

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

packages/nextjs/app/page.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,14 @@
33
import Link from "next/link";
44
import type { NextPage } from "next";
55
import { BugAntIcon, MagnifyingGlassIcon } from "@heroicons/react/24/outline";
6+
import { useScaffoldReadContract } from "~~/hooks/scaffold-eth";
67

78
const Home: NextPage = () => {
9+
const { data: checkedInCount, isLoading } = useScaffoldReadContract({
10+
contractName: "BatchRegistry",
11+
functionName: "checkedInCounter",
12+
});
13+
814
return (
915
<>
1016
<div className="flex items-center flex-col grow pt-10">
@@ -16,7 +22,11 @@ const Home: NextPage = () => {
1622
<p className="text-center text-lg">Get started by taking a look at your batch GitHub repository.</p>
1723
<p className="text-lg flex gap-2 justify-center">
1824
<span className="font-bold">Checked in builders count:</span>
19-
<span>To Be Implemented</span>
25+
{isLoading ? (
26+
<span className="loading loading-spinner loading-sm"></span>
27+
) : (
28+
<span>{checkedInCount?.toString()}</span>
29+
)}
2030
</p>
2131
</div>
2232

0 commit comments

Comments
 (0)