From 0f035d5d3a355dd6b262fa2ee740eb96dbdfbd41 Mon Sep 17 00:00:00 2001 From: Rohan Ahire <75326769+rohan-ahire06@users.noreply.github.com> Date: Fri, 16 Aug 2024 17:21:33 +0530 Subject: [PATCH] fix: builders profile links -Disabled links and dimmed opacity for builders without profile pages, ensuring users aren't redirected to 404 pages. -Highlighted addresses of builders with completed profile pages, making it easy to spot active profiles. --- .../app/builders/_components/MembersList.tsx | 71 ++++++++++++++----- packages/nextjs/app/builders/page.tsx | 35 ++++----- 2 files changed, 66 insertions(+), 40 deletions(-) diff --git a/packages/nextjs/app/builders/_components/MembersList.tsx b/packages/nextjs/app/builders/_components/MembersList.tsx index f7d80f8..c985e9c 100644 --- a/packages/nextjs/app/builders/_components/MembersList.tsx +++ b/packages/nextjs/app/builders/_components/MembersList.tsx @@ -1,10 +1,19 @@ +"use client"; + import React from "react"; import Link from "next/link"; import { AiOutlineLoading3Quarters } from "react-icons/ai"; import { Address } from "~~/components/scaffold-eth"; -import { useScaffoldEventHistory } from "~~/hooks/scaffold-eth"; +import { useScaffoldEventHistory, useScaffoldReadContract } from "~~/hooks/scaffold-eth"; + +const MembersList = ({ builders }: { builders: string[] }) => { + // Getting the list of builders who have completed their check-in. + const { data: checkedInnBuilders, isLoading: loading } = useScaffoldReadContract({ + contractName: "BatchRegistry", + functionName: "checkedInCounter", + }); -const MembersList = () => { + // Getting the list of builders' address list who have completed their check-in. const { data: MembersList } = useScaffoldEventHistory({ contractName: "BatchRegistry", eventName: "CheckedIn", @@ -16,22 +25,50 @@ const MembersList = () => { console.log("list", MembersList); return ( -
Builders :
++ {loading ? ( +
🏰 The Builders 🏗️ of BuidlGuidl: Batch #8
-Builders :
-- {loading ? ( -