Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/components/pagination/pagination.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,8 @@
@include font-scale();
color: var(--rp-ui-base-almost-black);
}

.pagination_with_controls {
justify-content: center;
gap: 24px;
}
Comment on lines 15 to +20
Copy link
Contributor

@ViktorSoroka07 ViktorSoroka07 Oct 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
}
.pagination_with_controls {
justify-content: center;
gap: 24px;
}
&.has-controls {
justify-content: center;
gap: 24px;
}
}

5 changes: 3 additions & 2 deletions src/components/pagination/pagination.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,18 @@ export const Pagination: FC<PaginationProps> = ({
}): ReactElement => {
const ofText = captions?.of || 'of';
const pageText = captions?.page || 'Page';
const isMoreThanOnePages = totalPages > 1;

return (
<div className={cx('pagination')}>
<div className={cx('pagination', isMoreThanOnePages ? 'pagination_with_controls' : '')}>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<div className={cx('pagination', isMoreThanOnePages ? 'pagination_with_controls' : '')}>
<div className={cx('pagination', {
'pagination_with_controls': isMoreThanOnePages,
)}>

<ItemCounter
activePage={activePage}
pageSize={pageSize}
totalItems={totalItems}
ofText={ofText}
itemsText={captions?.items || 'items'}
/>
{totalPages > 1 && (
{isMoreThanOnePages && (
<PageControls
activePage={activePage}
totalPages={totalPages}
Expand Down
Loading