forked from estevanmaito/windmill-react-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(pagination): added support to programmatically change active page
There are cases where users needs to programmatically change the active page number, eg. when searching, the page should change to first page. feat estevanmaito#42
- Loading branch information
1 parent
b7afcfd
commit a716486
Showing
5 changed files
with
53 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,6 @@ dist | |
dev | ||
style/output.css | ||
lib | ||
.env | ||
.env | ||
.DS_Store | ||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import React from 'react' | ||
|
||
import { Story, Meta } from '@storybook/react/types-6-0' | ||
|
||
import Pagination, { PaginationProps } from '../Pagination' | ||
|
||
export default { | ||
title: 'Pagination', | ||
component: Pagination, | ||
} as Meta | ||
|
||
const Template: Story<PaginationProps> = (args) => <Pagination {...args} /> | ||
|
||
export const Current = Template.bind({}) | ||
Current.args = { | ||
totalResults: 120, | ||
resultsPerPage: 10, | ||
onChange: () => {}, | ||
label: "Table navigation", | ||
} | ||
|
||
// With programmatically adjusted active page | ||
export const ActivePage = Template.bind({}) | ||
ActivePage.args = { | ||
totalResults: 50, | ||
resultsPerPage: 15, | ||
onChange: () => {}, | ||
label: "Table navigation", | ||
activePage: 3, | ||
} |