-
Notifications
You must be signed in to change notification settings - Fork 29
feat: change deps table pagination to 50 rows per page #120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -65,7 +65,7 @@ export default function Deps({ manifest, version }: PageProps) { | |
| dataSource={dependencies} | ||
| rowKey={'package'} | ||
| columns={columns} | ||
| pagination={{ size: 'small' }} | ||
| pagination={{ size: 'small', pageSize: 50 }} | ||
|
||
| /> | ||
| </Card> | ||
| </Col> | ||
|
|
@@ -75,7 +75,7 @@ export default function Deps({ manifest, version }: PageProps) { | |
| dataSource={devDependencies} | ||
| columns={columns} | ||
| rowKey={'package'} | ||
| pagination={{ size: 'small' }} | ||
| pagination={{ size: 'small', pageSize: 50 }} | ||
| /> | ||
| </Card> | ||
| </Col> | ||
|
|
@@ -85,7 +85,7 @@ export default function Deps({ manifest, version }: PageProps) { | |
| dataSource={optionalDependencies} | ||
| columns={columns} | ||
| rowKey={'package'} | ||
| pagination={{ size: 'small' }} | ||
| pagination={{ size: 'small', pageSize: 50 }} | ||
| /> | ||
| </Card> | ||
| </Col> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pagination configuration
{{ size: 'small', pageSize: 50 }}is duplicated for thedependencies,devDependencies, andoptionalDependenciestables. This use of a 'magic number' and repeated code can make future updates more difficult and error-prone.To improve maintainability and adhere to the DRY (Don't Repeat Yourself) principle, I recommend extracting this configuration into a constant. You can define it once and reuse it for all three tables.
For example, you could add this inside your component:
And then apply it to each table like this:
This would make the code cleaner and easier to update in the future.