Skip to content

Commit

Permalink
renamed to paged pagination
Browse files Browse the repository at this point in the history
  • Loading branch information
Snorre98 committed Nov 6, 2024
1 parent b98d53b commit 649a91f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions frontend/src/Components/Pagination/DrfPagination.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { ComponentMeta, ComponentStory } from '@storybook/react';
import { useState } from 'react';
import { DrfPagination } from './DrfPagination';
import { PagedPagination } from './DrfPagination';

export default {
title: 'Components/DRFPagination',
component: DrfPagination,
component: PagedPagination,
argTypes: {
currentPage: {
control: 'number',
Expand Down Expand Up @@ -44,15 +44,15 @@ export default {
},
},
},
} as ComponentMeta<typeof DrfPagination>;
} as ComponentMeta<typeof PagedPagination>;

// Template with state management
const Template: ComponentStory<typeof DrfPagination> = (args) => {
const Template: ComponentStory<typeof PagedPagination> = (args) => {
const [currentPage, setCurrentPage] = useState(args.currentPage);

return (
<div>
<DrfPagination {...args} currentPage={currentPage} onPageChange={setCurrentPage} />
<PagedPagination {...args} currentPage={currentPage} onPageChange={setCurrentPage} />
<p>Current page: {currentPage}</p>
</div>
);
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/Components/Pagination/DrfPagination.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const showStartEllipsis = (current: number, boundaryCount: number, siblingCount:
const showEndEllipsis = (current: number, total: number, boundaryCount: number, siblingCount: number): boolean =>
boundaryCount > 0 && siblingCount > 0 && current < total - boundaryCount - siblingCount;

export function DrfPagination({
export function PagedPagination({
currentPage,
totalItems,
pageSize,
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/Components/Pagination/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { DrfPagination } from './DrfPagination';
export { PagedPagination as DrfPagination } from './DrfPagination';

0 comments on commit 649a91f

Please sign in to comment.