Skip to content

Commit

Permalink
fix(frontend): fix pagination
Browse files Browse the repository at this point in the history
  • Loading branch information
lionelB committed Aug 27, 2020
1 parent b2efaa4 commit 09840d3
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions targets/frontend/src/components/pagination/index.js
Expand Up @@ -67,14 +67,13 @@ export function Pagination({
if (nbPage === 1) {
return null;
}
if (nbPage <= visibleRange * 2) {
return <PaginationList>{allPages}</PaginationList>;
}
return (
<Flex sx={{ justifyContent: "center" }}>
<List sx={{ display: "flex", fontSize: "xxsmall" }}>
<Inline space="xxsmall">
{startPagination.concat(pages, endPagination)}
</Inline>
</List>
</Flex>
<PaginationList>
{startPagination.concat(pages, endPagination)}
</PaginationList>
);
}

Expand All @@ -85,3 +84,11 @@ Pagination.propTypes = {
pageSize: PropTypes.number,
visibleRange: PropTypes.number,
};

function PaginationList({ children }) {
<Flex sx={{ justifyContent: "center" }}>
<List sx={{ display: "flex", fontSize: "xxsmall" }}>
<Inline space="xxsmall">{children}</Inline>
</List>
</Flex>;
}

0 comments on commit 09840d3

Please sign in to comment.