File tree 1 file changed +6
-2
lines changed
web/src/pages/Dashboard/Courts
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import Skeleton from "react-loading-skeleton";
6
6
import CourtCard from "./CourtCard" ;
7
7
import Header from "./Header" ;
8
8
import { useJurorStakeDetailsQuery } from "queries/useJurorStakeDetailsQuery" ;
9
+ import { useSortitionModuleGetJurorBalance } from "hooks/contracts/generated" ;
9
10
10
11
const Container = styled . div `
11
12
margin-top: 64px;
@@ -31,13 +32,16 @@ const StyledLabel = styled.label`
31
32
const Courts : React . FC = ( ) => {
32
33
const { address } = useAccount ( ) ;
33
34
const { data : stakeData , isLoading } = useJurorStakeDetailsQuery ( address ?. toLowerCase ( ) as `0x${string } `) ;
35
+ const { data : jurorBalance } = useSortitionModuleGetJurorBalance ( {
36
+ args : [ address as `0x${string } `, BigInt ( 1 ) ] ,
37
+ } ) ;
34
38
const stakedCourts = stakeData ?. jurorTokensPerCourts ?. filter ( ( { staked } ) => staked > 0 ) ;
35
39
const isStaked = stakedCourts && stakedCourts . length > 0 ;
36
- const lockedStake = stakeData ?. jurorTokensPerCourts ?. [ 0 ] ?. locked ;
40
+ const lockedStake = jurorBalance ?. [ 1 ] . toString ( ) ;
37
41
38
42
return (
39
43
< Container >
40
- < Header lockedStake = { lockedStake } />
44
+ < Header lockedStake = { lockedStake ?? "" } />
41
45
{ isLoading ? < Skeleton /> : null }
42
46
{ ! isStaked && ! isLoading ? < StyledLabel > You are not staked in any court</ StyledLabel > : null }
43
47
{ isStaked && ! isLoading ? (
You can’t perform that action at this time.
0 commit comments