Skip to content

Commit

Permalink
add loading on reputation-score page
Browse files Browse the repository at this point in the history
  • Loading branch information
mehdi-torabiv committed Dec 11, 2024
1 parent 249f213 commit 729c190
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/pages/reputation-score/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { useAccount, useReadContract } from 'wagmi';

import { engagementContracts } from '@/lib/contracts/engagement/contracts';

import SimpleBackdrop from '@/components/global/LoadingBackdrop';
import SEO from '@/components/global/SEO';
import TcBoxContainer from '@/components/shared/TcBox/TcBoxContainer';

Expand All @@ -25,13 +26,17 @@ function ReputationScore() {
(contract) => contract.chainId === chainId
);

const { data: hasMinted } = useReadContract({
const { data: hasMinted, isLoading } = useReadContract({
address: engagementContract?.address as `0x${string}`,
abi: engagementContract?.abi as Abi,
functionName: 'balanceOf',
args: [address, dynamicNFTModuleInfo?.metadata[0]?.tokenId],
});

if(isConnected && isLoading) {
return <SimpleBackdrop />
}

return (
<>
<SEO titleTemplate='Reputation Score' />
Expand Down

0 comments on commit 729c190

Please sign in to comment.