Skip to content

Commit

Permalink
fix(pagination): pass className and others to element (#759)
Browse files Browse the repository at this point in the history
* fix(pagination): pass className and others to element

* chore: release v2.3.8
  • Loading branch information
unix authored Mar 22, 2022
1 parent 2abcb36 commit cbde532
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Pagination should render correctly 1`] = `
"<nav><li><button class=\\"disabled\\">prev</button><style>
"<nav class=\\"\\"><li><button class=\\"disabled\\">prev</button><style>
li {
margin-right: 0.428em;
display: inline-block;
Expand Down
6 changes: 5 additions & 1 deletion components/pagination/pagination.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@ interface Props {
count?: number
limit?: number
onChange?: (val: number) => void
className?: string
}

const defaultProps = {
initialPage: 1,
count: 1,
limit: 7,
className: '',
}

type NativeAttrs = Omit<React.HTMLAttributes<any>, keyof Props>
Expand All @@ -35,6 +37,8 @@ const PaginationComponent: React.FC<React.PropsWithChildren<PaginationProps>> =
limit,
children,
onChange,
className,
...props
}: React.PropsWithChildren<PaginationProps> & typeof defaultProps) => {
const { SCALES } = useScale()
const [page, setPage, pageRef] = useCurrentState(initialPage)
Expand Down Expand Up @@ -79,7 +83,7 @@ const PaginationComponent: React.FC<React.PropsWithChildren<PaginationProps>> =

return (
<PaginationContext.Provider value={values}>
<nav>
<nav className={className} {...props}>
{prevItem}
<PaginationPages count={count} current={page} limit={limit} setPage={setPage} />
{nextItem}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@geist-ui/core",
"version": "2.3.7",
"version": "2.3.8",
"main": "dist/index.js",
"module": "esm/index.js",
"types": "esm/index.d.ts",
Expand Down

0 comments on commit cbde532

Please sign in to comment.