aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/molecules/nav/pagination.tsx
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2022-05-20 15:37:08 +0200
committerArmand Philippot <git@armandphilippot.com>2022-05-20 15:37:08 +0200
commitf4c7ab4e306d2f04324853e67032d370abd65d0c (patch)
tree2c7d1ad467d6c52bc134202f0d33f7524f9056fa /src/components/molecules/nav/pagination.tsx
parentbbd63400f94b43fde04449e0c71d14763d893e6a (diff)
chore: handle blog pagination when JS is disabled
Diffstat (limited to 'src/components/molecules/nav/pagination.tsx')
-rw-r--r--src/components/molecules/nav/pagination.tsx10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/components/molecules/nav/pagination.tsx b/src/components/molecules/nav/pagination.tsx
index 38f6841..934b50a 100644
--- a/src/components/molecules/nav/pagination.tsx
+++ b/src/components/molecules/nav/pagination.tsx
@@ -44,12 +44,12 @@ const Pagination: FC<PaginationProps> = ({
className = '',
current,
perPage,
- siblings = 1,
+ siblings = 2,
total,
...props
}) => {
const intl = useIntl();
- const totalPages = Math.ceil(total / perPage);
+ const totalPages = Math.round(total / perPage);
const hasPreviousPage = current > 1;
const previousPageName = intl.formatMessage(
{
@@ -205,14 +205,14 @@ const Pagination: FC<PaginationProps> = ({
return (
<nav className={`${styles.wrapper} ${className}`} {...props}>
+ <ul className={`${styles.list} ${styles['list--pages']}`}>
+ {getPages(current, totalPages)}
+ </ul>
<ul className={styles.list}>
{hasPreviousPage &&
getItem('previous', previousPageName, previousPageUrl)}
{hasNextPage && getItem('next', nextPageName, nextPageUrl)}
</ul>
- <ul className={`${styles.list} ${styles['list--pages']}`}>
- {getPages(current, totalPages)}
- </ul>
</nav>
);
};