diff options
Diffstat (limited to 'src/components/molecules/nav')
| -rw-r--r-- | src/components/molecules/nav/pagination.module.scss | 2 | ||||
| -rw-r--r-- | src/components/molecules/nav/pagination.tsx | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/components/molecules/nav/pagination.module.scss b/src/components/molecules/nav/pagination.module.scss index a8cef47..56c5bfc 100644 --- a/src/components/molecules/nav/pagination.module.scss +++ b/src/components/molecules/nav/pagination.module.scss @@ -13,7 +13,7 @@ &--pages { column-gap: var(--spacing-2xs); - margin-top: var(--spacing-sm); + margin-bottom: var(--spacing-sm); } } 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> ); }; |
