@@ -5,15 +5,18 @@ import { MAX_WIDTH_LANDSCAPE, landscapeStyle } from "styles/landscapeStyle";
55import { responsiveSize } from "styles/responsiveSize" ;
66
77import { isUndefined } from "utils/index" ;
8+ import { getOneYearAgoTimestamp } from "utils/date" ;
89
910import { useTopUsersByCoherenceScore } from "queries/useTopUsersByCoherenceScore" ;
11+ import { useHomePageQuery } from "queries/useHomePageQuery" ;
1012
1113import { SkeletonDisputeListItem } from "components/StyledSkeleton" ;
1214import Search from "./Search" ;
1315import StatsAndFilters from "./StatsAndFilters" ;
1416import JurorCard from "../Home/TopJurors/JurorCard" ;
1517import { ListContainer , StyledLabel } from "../Home/TopJurors" ;
1618import Header from "../Home/TopJurors/Header" ;
19+ import { getLastOrZero } from "../Home/CourtOverview/Stats" ;
1720
1821const Container = styled . div `
1922 width: 100%;
@@ -37,25 +40,28 @@ const StyledTitle = styled.h1`
3740const Jurors : React . FC = ( ) => {
3841 const { data : queryJurors } = useTopUsersByCoherenceScore ( 1000 ) ;
3942
40- const topJurors = queryJurors ?. users ?. map ( ( juror , index ) => ( {
43+ const jurors = queryJurors ?. users ?. map ( ( juror , index ) => ( {
4144 ...juror ,
4245 rank : index + 1 ,
4346 } ) ) ;
4447
48+ // const { data } = useHomePageQuery(getOneYearAgoTimestamp());
49+ // const totalActiveJurors = data && getLastOrZero(data["counters"], "activeJurors");
50+
4551 return (
4652 < Container >
4753 < StyledTitle > Jurors Leaderboard</ StyledTitle >
4854 < Search />
4955 < StatsAndFilters totalJurors = { 0 } />
5056
51- { ! isUndefined ( topJurors ) && topJurors . length === 0 ? (
57+ { ! isUndefined ( jurors ) && jurors . length === 0 ? (
5258 < StyledLabel > There are no jurors staked yet.</ StyledLabel >
5359 ) : (
5460 < ListContainer >
5561 < Header />
56- { ! isUndefined ( topJurors )
57- ? topJurors . map ( ( juror ) => < JurorCard key = { juror . rank } address = { juror . id } { ...juror } /> )
58- : [ ...Array ( 5 ) ] . map ( ( _ , i ) => < SkeletonDisputeListItem key = { i } /> ) }
62+ { ! isUndefined ( jurors )
63+ ? jurors . map ( ( juror ) => < JurorCard key = { juror . rank } address = { juror . id } { ...juror } /> )
64+ : [ ...Array ( 14 ) ] . map ( ( _ , i ) => < SkeletonDisputeListItem key = { i } /> ) }
5965 </ ListContainer >
6066 ) }
6167 </ Container >
0 commit comments