-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7f4b81f
commit 94902e8
Showing
32 changed files
with
329 additions
and
346 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
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
27 changes: 0 additions & 27 deletions
27
docs/src/pages/components/pagination/PaginationLinkChildren.js
This file was deleted.
Oops, something went wrong.
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,47 @@ | ||
import React from 'react'; | ||
import { usePagination } from '@material-ui/lab/Pagination'; | ||
import { makeStyles } from '@material-ui/core/styles'; | ||
|
||
const useStyles = makeStyles({ | ||
ul: { | ||
listStyle: 'none', | ||
padding: 0, | ||
margin: 0, | ||
display: 'flex', | ||
}, | ||
}); | ||
|
||
export default function UsePagination() { | ||
const classes = useStyles(); | ||
const { items } = usePagination({ | ||
count: 10, | ||
}); | ||
|
||
return ( | ||
<nav> | ||
<ul className={classes.ul}> | ||
{items.map(({ page, type, selected, ...item }, index) => { | ||
let children; | ||
|
||
if (type === 'start-ellipsis' || type === 'end-ellipsis') { | ||
children = '…'; | ||
} else if (type === 'page') { | ||
children = ( | ||
<button type="button" style={{ fontWeight: selected ? 'bold' : null }} {...item}> | ||
{page} | ||
</button> | ||
); | ||
} else { | ||
children = ( | ||
<button type="button" {...item}> | ||
{type} | ||
</button> | ||
); | ||
} | ||
|
||
return <li key={index}>{children}</li>; | ||
})} | ||
</ul> | ||
</nav> | ||
); | ||
} |
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
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
export { default } from './Pagination'; | ||
export { default as usePagination } from './usePagination'; | ||
export * from './Pagination'; | ||
export { default as usePagination } from './usePagination'; | ||
export * from './usePagination'; |
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
Oops, something went wrong.