@@ -6,7 +6,6 @@ import { isUndefined } from "utils/index";
66import { StandardPagination } from "@kleros/ui-components-library" ;
77
88import { useJurorsByCoherenceScore } from "queries/useJurorsByCoherenceScore" ;
9- import useIsDesktop from "hooks/useIsDesktop" ;
109
1110import { OrderDirection } from "src/graphql/graphql" ;
1211
@@ -15,6 +14,7 @@ import JurorCard from "../Home/TopJurors/JurorCard";
1514import { ListContainer , StyledLabel } from "../Home/TopJurors" ;
1615import Header from "../Home/TopJurors/Header" ;
1716import { decodeURIFilter } from "utils/uri" ;
17+ import { useScrollTop } from "hooks/useScrollTop" ;
1818
1919interface IDisplayJurors {
2020 totalLeaderboardJurors : number ;
@@ -28,10 +28,10 @@ const StyledPagination = styled(StandardPagination)`
2828
2929const DisplayJurors : React . FC < IDisplayJurors > = ( { totalLeaderboardJurors } ) => {
3030 const { page, order, filter } = useParams ( ) ;
31+ const scrollTop = useScrollTop ( ) ;
3132 const { id : searchValue } = decodeURIFilter ( filter ?? "all" ) ;
3233 const navigate = useNavigate ( ) ;
33- const isDesktop = useIsDesktop ( ) ;
34- const jurorsPerPage = isDesktop ? 20 : 10 ;
34+ const jurorsPerPage = 10 ;
3535 const currentPage = parseInt ( page ?? "1" ) ;
3636 const jurorSkip = jurorsPerPage * ( currentPage - 1 ) ;
3737 const { data : queryJurors } = useJurorsByCoherenceScore (
@@ -62,6 +62,7 @@ const DisplayJurors: React.FC<IDisplayJurors> = ({ totalLeaderboardJurors }) =>
6262 ) ;
6363
6464 const handlePageChange = ( newPage : number ) => {
65+ scrollTop ( true ) ;
6566 navigate ( `/jurors/${ newPage } /${ order } /${ filter } ` ) ;
6667 } ;
6768
0 commit comments