Skip to content

Commit cbde532

Browse files
authored
fix(pagination): pass className and others to element (#759)
* fix(pagination): pass className and others to element * chore: release v2.3.8
1 parent 2abcb36 commit cbde532

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

components/pagination/__tests__/__snapshots__/pagination.test.tsx.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

33
exports[`Pagination should render correctly 1`] = `
4-
"<nav><li><button class=\\"disabled\\">prev</button><style>
4+
"<nav class=\\"\\"><li><button class=\\"disabled\\">prev</button><style>
55
li {
66
margin-right: 0.428em;
77
display: inline-block;

components/pagination/pagination.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,14 @@ interface Props {
1717
count?: number
1818
limit?: number
1919
onChange?: (val: number) => void
20+
className?: string
2021
}
2122

2223
const defaultProps = {
2324
initialPage: 1,
2425
count: 1,
2526
limit: 7,
27+
className: '',
2628
}
2729

2830
type NativeAttrs = Omit<React.HTMLAttributes<any>, keyof Props>
@@ -35,6 +37,8 @@ const PaginationComponent: React.FC<React.PropsWithChildren<PaginationProps>> =
3537
limit,
3638
children,
3739
onChange,
40+
className,
41+
...props
3842
}: React.PropsWithChildren<PaginationProps> & typeof defaultProps) => {
3943
const { SCALES } = useScale()
4044
const [page, setPage, pageRef] = useCurrentState(initialPage)
@@ -79,7 +83,7 @@ const PaginationComponent: React.FC<React.PropsWithChildren<PaginationProps>> =
7983

8084
return (
8185
<PaginationContext.Provider value={values}>
82-
<nav>
86+
<nav className={className} {...props}>
8387
{prevItem}
8488
<PaginationPages count={count} current={page} limit={limit} setPage={setPage} />
8589
{nextItem}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@geist-ui/core",
3-
"version": "2.3.7",
3+
"version": "2.3.8",
44
"main": "dist/index.js",
55
"module": "esm/index.js",
66
"types": "esm/index.d.ts",

0 commit comments

Comments
 (0)