@@ -6,7 +6,6 @@ import { isUndefined } from "utils/index";
6
6
import { StandardPagination } from "@kleros/ui-components-library" ;
7
7
8
8
import { useJurorsByCoherenceScore } from "queries/useJurorsByCoherenceScore" ;
9
- import useIsDesktop from "hooks/useIsDesktop" ;
10
9
11
10
import { OrderDirection } from "src/graphql/graphql" ;
12
11
@@ -15,6 +14,7 @@ import JurorCard from "../Home/TopJurors/JurorCard";
15
14
import { ListContainer , StyledLabel } from "../Home/TopJurors" ;
16
15
import Header from "../Home/TopJurors/Header" ;
17
16
import { decodeURIFilter } from "utils/uri" ;
17
+ import { useScrollTop } from "hooks/useScrollTop" ;
18
18
19
19
interface IDisplayJurors {
20
20
totalLeaderboardJurors : number ;
@@ -28,10 +28,10 @@ const StyledPagination = styled(StandardPagination)`
28
28
29
29
const DisplayJurors : React . FC < IDisplayJurors > = ( { totalLeaderboardJurors } ) => {
30
30
const { page, order, filter } = useParams ( ) ;
31
+ const scrollTop = useScrollTop ( ) ;
31
32
const { id : searchValue } = decodeURIFilter ( filter ?? "all" ) ;
32
33
const navigate = useNavigate ( ) ;
33
- const isDesktop = useIsDesktop ( ) ;
34
- const jurorsPerPage = isDesktop ? 20 : 10 ;
34
+ const jurorsPerPage = 10 ;
35
35
const currentPage = parseInt ( page ?? "1" ) ;
36
36
const jurorSkip = jurorsPerPage * ( currentPage - 1 ) ;
37
37
const { data : queryJurors } = useJurorsByCoherenceScore (
@@ -62,6 +62,7 @@ const DisplayJurors: React.FC<IDisplayJurors> = ({ totalLeaderboardJurors }) =>
62
62
) ;
63
63
64
64
const handlePageChange = ( newPage : number ) => {
65
+ scrollTop ( true ) ;
65
66
navigate ( `/jurors/${ newPage } /${ order } /${ filter } ` ) ;
66
67
} ;
67
68
0 commit comments