-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ff978cb
commit 78f6dab
Showing
2 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
packages/nextjs/components/scaffold-eth/RainbowKitCustomConnectButton/BatchDetails.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { Address } from "viem"; | ||
import { useScaffoldReadContract } from "~~/hooks/scaffold-eth"; | ||
|
||
type BatchProps = { | ||
address: Address; | ||
}; | ||
|
||
const zeroAddress = "0x0000000000000000000000000000000000000000"; | ||
|
||
export const BatchDetails = ({ address }: BatchProps) => { | ||
console.log(address); | ||
|
||
const { data: allowListed, isLoading: allowListLoading } = useScaffoldReadContract({ | ||
contractName: "BatchRegistry", | ||
functionName: "allowList", | ||
args: [address], | ||
}); | ||
|
||
const { data: checkedIn, isLoading: checkedInLoading } = useScaffoldReadContract({ | ||
contractName: "BatchRegistry", | ||
functionName: "yourContractAddress", | ||
args: [address], | ||
}); | ||
console.log(allowListed, checkedIn); | ||
|
||
return ( | ||
<> | ||
{!allowListLoading && !checkedInLoading && ( | ||
<div> | ||
<span className="text-xs">{allowListed ? <p>✅ Allow Listed</p> : <p>❌ Not Allow Listed</p>}</span> | ||
<span className="text-xs">{checkedIn != zeroAddress ? <p>✅ Checked in</p> : <p>❌ Not checked in</p>}</span> | ||
</div> | ||
)} | ||
</> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters