@@ -5,15 +5,18 @@ import { MAX_WIDTH_LANDSCAPE, landscapeStyle } from "styles/landscapeStyle";
5
5
import { responsiveSize } from "styles/responsiveSize" ;
6
6
7
7
import { isUndefined } from "utils/index" ;
8
+ import { getOneYearAgoTimestamp } from "utils/date" ;
8
9
9
10
import { useTopUsersByCoherenceScore } from "queries/useTopUsersByCoherenceScore" ;
11
+ import { useHomePageQuery } from "queries/useHomePageQuery" ;
10
12
11
13
import { SkeletonDisputeListItem } from "components/StyledSkeleton" ;
12
14
import Search from "./Search" ;
13
15
import StatsAndFilters from "./StatsAndFilters" ;
14
16
import JurorCard from "../Home/TopJurors/JurorCard" ;
15
17
import { ListContainer , StyledLabel } from "../Home/TopJurors" ;
16
18
import Header from "../Home/TopJurors/Header" ;
19
+ import { getLastOrZero } from "../Home/CourtOverview/Stats" ;
17
20
18
21
const Container = styled . div `
19
22
width: 100%;
@@ -37,25 +40,28 @@ const StyledTitle = styled.h1`
37
40
const Jurors : React . FC = ( ) => {
38
41
const { data : queryJurors } = useTopUsersByCoherenceScore ( 1000 ) ;
39
42
40
- const topJurors = queryJurors ?. users ?. map ( ( juror , index ) => ( {
43
+ const jurors = queryJurors ?. users ?. map ( ( juror , index ) => ( {
41
44
...juror ,
42
45
rank : index + 1 ,
43
46
} ) ) ;
44
47
48
+ // const { data } = useHomePageQuery(getOneYearAgoTimestamp());
49
+ // const totalActiveJurors = data && getLastOrZero(data["counters"], "activeJurors");
50
+
45
51
return (
46
52
< Container >
47
53
< StyledTitle > Jurors Leaderboard</ StyledTitle >
48
54
< Search />
49
55
< StatsAndFilters totalJurors = { 0 } />
50
56
51
- { ! isUndefined ( topJurors ) && topJurors . length === 0 ? (
57
+ { ! isUndefined ( jurors ) && jurors . length === 0 ? (
52
58
< StyledLabel > There are no jurors staked yet.</ StyledLabel >
53
59
) : (
54
60
< ListContainer >
55
61
< 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 } /> ) }
59
65
</ ListContainer >
60
66
) }
61
67
</ Container >
0 commit comments