best-react-pagination 0.1.0 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/README.md +18 -13
  2. package/package.json +1 -1
  3. package/.babelrc +0 -7
  4. package/.editorconfig +0 -9
  5. package/.eslintignore +0 -2
  6. package/.eslintrc.js +0 -37
  7. package/.husky/commit-msg +0 -4
  8. package/.husky/pre-commit +0 -7
  9. package/.lintstagedrc.json +0 -3
  10. package/commitlint.config.js +0 -1
  11. package/demo/.babelrc +0 -14
  12. package/demo/public/index.html +0 -17
  13. package/demo/src/App.tsx +0 -24
  14. package/demo/src/Pagination/components/Item/Item.tsx +0 -19
  15. package/demo/src/Pagination/components/Item/index.ts +0 -1
  16. package/demo/src/Pagination/components/ItemList/ItemList.tsx +0 -17
  17. package/demo/src/Pagination/components/ItemList/index.ts +0 -1
  18. package/demo/src/Pagination/components/Wrapper/Wrapper.tsx +0 -17
  19. package/demo/src/Pagination/components/Wrapper/index.ts +0 -1
  20. package/demo/src/Pagination/components/constants.ts +0 -49
  21. package/demo/src/Pagination/components/index.ts +0 -3
  22. package/demo/src/Pagination/components/utils.ts +0 -3
  23. package/demo/src/Pagination/index.tsx +0 -356
  24. package/demo/src/index.html +0 -11
  25. package/demo/src/index.tsx +0 -7
  26. package/demo/tsconfig.json +0 -18
  27. package/demo/webpack.config.js +0 -50
  28. package/dist/components/Item/Item.d.ts +0 -10
  29. package/dist/components/Item/index.d.ts +0 -1
  30. package/dist/components/ItemList/ItemList.d.ts +0 -7
  31. package/dist/components/ItemList/index.d.ts +0 -1
  32. package/dist/components/Wrapper/Wrapper.d.ts +0 -7
  33. package/dist/components/Wrapper/index.d.ts +0 -1
  34. package/dist/components/constants.d.ts +0 -9
  35. package/dist/components/index.d.ts +0 -3
  36. package/dist/components/utils.d.ts +0 -1
  37. package/husky.config.js +0 -5
  38. package/index.js +0 -1
  39. package/lib/components/Item/Item.tsx +0 -19
  40. package/lib/components/Item/index.ts +0 -1
  41. package/lib/components/ItemList/ItemList.tsx +0 -17
  42. package/lib/components/ItemList/index.ts +0 -1
  43. package/lib/components/Wrapper/Wrapper.tsx +0 -17
  44. package/lib/components/Wrapper/index.ts +0 -1
  45. package/lib/components/constants.ts +0 -49
  46. package/lib/components/index.ts +0 -3
  47. package/lib/components/utils.ts +0 -3
  48. package/lib/index.tsx +0 -356
  49. package/tsconfig.json +0 -24
  50. package/webpack.config.ts +0 -53
package/README.md CHANGED
@@ -28,18 +28,23 @@ const YourComponent: FC = () => {
28
28
  };
29
29
  ```
30
30
 
31
+ #### Example https://codesandbox.io/s/lingering-breeze-gh2dk
32
+
31
33
  ## Props
32
34
 
33
- | Name | Type | Description |
34
- | ------------------- | ---------------------------------------------- | ---------------------------------------------------------------------- |
35
- | `paginationStart` | `Number` | **Required.** The number of start pages on your logic (0 or 1). |
36
- | `currentIndex` | `Number` | **Required.** The current index from hook useState of pages displayed. |
37
- | `totalPages` | `Number` | **Required.** The range of pages displayed. |
38
- | `setIndex` | `React.Dispatch<React.SetStateAction<number>>` | **Required.** The dispatch from hook useState |
39
- | `isDefaultStyles` | `Boolean` | **Default true** |
40
- | `wrapperClass` | `String` | Css class |
41
- | `itemListClass` | `String` | Css class |
42
- | `itemClass` | `String` | Css class |
43
- | `selectedItemClass` | `String` | Css class |
44
- | `disableItemClass` | `String` | Css class |
45
- | `className` | `String` | **Field for styled-component** |
35
+ | Name | Type | Description |
36
+ | ------------------- |----------------------------------| ---------------------------------------------------------------------- |
37
+ | `paginationStart` | `Number` | **Required.** The number of start pages on your logic (0 or 1). |
38
+ | `currentIndex` | `Number` | **Required.** The current index from hook useState of pages displayed. |
39
+ | `totalPages` | `Number` | **Required.** The range of pages displayed. |
40
+ | `setIndex` | `React.SetStateAction<number>` | **Required.** The dispatch from hook useState |
41
+ | `isDefaultStyles` | `Boolean` | **Default true** |
42
+ | `wrapperClass` | `String` | Css class |
43
+ | `itemListClass` | `String` | Css class |
44
+ | `itemClass` | `String` | Css class |
45
+ | `selectedItemClass` | `String` | Css class |
46
+ | `disableItemClass` | `String` | Css class |
47
+ | `className` | `String` | **Field for styled-component** |
48
+
49
+ ### Remark
50
+ For rewrite default styles - use !important in your css
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "best-react-pagination",
3
- "version": "0.1.0",
3
+ "version": "0.1.4",
4
4
  "description": "Pagination for work with React",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/.babelrc DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "presets": [
3
- "@babel/preset-env",
4
- "@babel/preset-typescript",
5
- "@babel/preset-react"
6
- ]
7
- }
package/.editorconfig DELETED
@@ -1,9 +0,0 @@
1
- root = true
2
-
3
- [*]
4
- indent_style = space
5
- indent_size = 2
6
- end_of_line = lf
7
- charset = utf-8
8
- insert_final_newline = true
9
- max_line_length = 120
package/.eslintignore DELETED
@@ -1,2 +0,0 @@
1
- /dist
2
- webpack.config.ts
package/.eslintrc.js DELETED
@@ -1,37 +0,0 @@
1
- module.exports = {
2
- root: true,
3
- env: {
4
- node: true,
5
- browser: true,
6
- es2021: true,
7
- },
8
- plugins: ["@typescript-eslint", "react"],
9
- extends: [
10
- "eslint:recommended",
11
- "plugin:@typescript-eslint/eslint-recommended",
12
- "plugin:@typescript-eslint/recommended",
13
- "plugin:react/recommended",
14
- "plugin:react-hooks/recommended",
15
- ],
16
- parser: "@typescript-eslint/parser",
17
- parserOptions: {
18
- ecmaFeatures: {
19
- tsconfigRootDir: __dirname,
20
- project: ["./tsconfig.json"],
21
- jsx: true,
22
- },
23
- ecmaVersion: 2021,
24
- sourceType: "module",
25
- },
26
- ignorePatterns: [".eslintrc.js"],
27
- rules: {
28
- "@typescript-eslint/no-var-requires": "off",
29
- "@typescript-eslint/no-unused-vars": ["error", { "vars": "all", "args": "after-used", "ignoreRestSiblings": false }]
30
- },
31
- settings: {
32
- react: {
33
- pragma: "React",
34
- version: "detect",
35
- },
36
- },
37
- };
package/.husky/commit-msg DELETED
@@ -1,4 +0,0 @@
1
- #!/bin/sh
2
- . "$(dirname "$0")/_/husky.sh"
3
-
4
- npx --no-install commitlint --edit "$1"
package/.husky/pre-commit DELETED
@@ -1,7 +0,0 @@
1
- #!/usr/bin/env sh
2
- . "$(dirname "$0")/_/husky.sh"
3
-
4
- npm run build
5
- git add dist
6
- git add lib
7
- npx lint-staged
@@ -1,3 +0,0 @@
1
- {
2
- "demo/src/**/*.(ts|tsx)": ["npm run lint:write", "npm run prettier"]
3
- }
@@ -1 +0,0 @@
1
- module.exports = {extends: ['@commitlint/config-conventional']}
package/demo/.babelrc DELETED
@@ -1,14 +0,0 @@
1
- {
2
- "presets": [
3
- [
4
- "@babel/preset-env",
5
- {
6
- "modules": false
7
- }
8
- ],
9
- "@babel/preset-react"
10
- ],
11
- "plugins": [
12
- "react-hot-loader/babel"
13
- ]
14
- }
@@ -1,17 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width, initial-scale=1" />
6
- <meta name="theme-color" content="#000000" />
7
- <meta
8
- name="description"
9
- content="Web site created using create-react-app"
10
- />
11
- <title>React App</title>
12
- </head>
13
- <body>
14
- <noscript>You need to enable JavaScript to run this app.</noscript>
15
- <div id="root"></div>
16
- </body>
17
- </html>
package/demo/src/App.tsx DELETED
@@ -1,24 +0,0 @@
1
- import React, { FC, useState } from "react";
2
- import { hot } from "react-hot-loader/root";
3
- import Pagination from "./Pagination";
4
-
5
- const App: FC = () => {
6
- const [index, setIndex] = useState(1);
7
- const totalPages = 10;
8
-
9
- console.log(`Current: ${index}. Total: ${totalPages}`);
10
-
11
- return (
12
- <>
13
- <Pagination
14
- paginationStart={1}
15
- currentIndex={index}
16
- setIndex={setIndex}
17
- totalPages={totalPages}
18
- isDefaultStyles={true}
19
- />
20
- </>
21
- );
22
- };
23
-
24
- export default hot(App);
@@ -1,19 +0,0 @@
1
- import React, { FC } from "react";
2
- import { defaultStyles, defaultStylesEnum } from "../constants";
3
-
4
- interface ItemProps {
5
- isDefaultStyles: boolean | undefined;
6
- itemClass: string;
7
- itemStyle: defaultStylesEnum;
8
- onClick?: () => void;
9
- }
10
-
11
- const Item: FC<ItemProps> = ({ isDefaultStyles, itemClass, itemStyle, onClick, children }) => {
12
- return (
13
- <li className={itemClass} style={isDefaultStyles ? defaultStyles[itemStyle] : undefined} onClick={onClick}>
14
- {children}
15
- </li>
16
- );
17
- };
18
-
19
- export default Item;
@@ -1 +0,0 @@
1
- export { default } from "./Item";
@@ -1,17 +0,0 @@
1
- import React, { FC } from "react";
2
- import { defaultStyles } from "../constants";
3
-
4
- interface ItemListProps {
5
- isDefaultStyles: boolean | undefined;
6
- itemListClass: string;
7
- }
8
-
9
- const ItemList: FC<ItemListProps> = ({ isDefaultStyles, itemListClass, children }) => {
10
- return (
11
- <ul className={itemListClass} style={isDefaultStyles ? defaultStyles.itemListClass : undefined}>
12
- {children}
13
- </ul>
14
- );
15
- };
16
-
17
- export default ItemList;
@@ -1 +0,0 @@
1
- export { default } from "./ItemList";
@@ -1,17 +0,0 @@
1
- import React, { FC } from "react";
2
- import { defaultStyles } from "../constants";
3
-
4
- interface WrapperProps {
5
- isDefaultStyles: boolean | undefined;
6
- wrapperClass: string;
7
- }
8
-
9
- const Wrapper: FC<WrapperProps> = ({ isDefaultStyles, wrapperClass, children }) => {
10
- return (
11
- <div className={wrapperClass} style={isDefaultStyles ? defaultStyles.wrapperClass : undefined}>
12
- {children}
13
- </div>
14
- );
15
- };
16
-
17
- export default Wrapper;
@@ -1 +0,0 @@
1
- export { default } from "./Wrapper";
@@ -1,49 +0,0 @@
1
- import React from "react";
2
-
3
- export enum defaultStylesEnum {
4
- wrapperClass = "wrapperClass",
5
- itemListClass = "itemListClass",
6
- itemClass = "itemClass",
7
- selectedItemClass = "selectedItemClass",
8
- disableItemClass = "disableItemClass",
9
- }
10
-
11
- export const defaultStyles: Record<defaultStylesEnum, React.CSSProperties> = {
12
- wrapperClass: {
13
- position: "sticky",
14
- display: "flex",
15
- justifyContent: "center",
16
- alignItems: "center",
17
- width: "100%",
18
- bottom: 0,
19
- },
20
- itemListClass: {
21
- padding: "10px 0",
22
- },
23
- itemClass: {
24
- display: "inline",
25
- cursor: "pointer",
26
- padding: "6px 12px",
27
- borderRadius: "4px",
28
- margin: "0 2px",
29
- backgroundColor: "#45c954",
30
- userSelect: "none",
31
- },
32
- selectedItemClass: {
33
- display: "inline",
34
- cursor: "pointer",
35
- padding: "6px 12px",
36
- borderRadius: "4px",
37
- margin: "0 2px",
38
- backgroundColor: "#48bbff",
39
- userSelect: "none",
40
- },
41
- disableItemClass: {
42
- display: "inline",
43
- cursor: "not-allowed",
44
- padding: "6px 12px",
45
- borderRadius: "4px",
46
- margin: "0 2px",
47
- userSelect: "none",
48
- },
49
- };
@@ -1,3 +0,0 @@
1
- export { default as Wrapper } from "./Wrapper";
2
- export { default as ItemList } from "./ItemList";
3
- export { default as Item } from "./Item";
@@ -1,3 +0,0 @@
1
- export const range = (count: number): Array<number> => {
2
- return [...Array(count).keys()].map((i) => i);
3
- };
@@ -1,356 +0,0 @@
1
- import React, { FC } from "react";
2
- import { defaultStylesEnum } from "./components/constants";
3
- import { Item, ItemList, Wrapper } from "./components";
4
- import { range } from "./components/utils";
5
-
6
- interface PaginationProps {
7
- paginationStart: 0 | 1;
8
- currentIndex: number;
9
- totalPages: number;
10
- setIndex: React.Dispatch<React.SetStateAction<number>>;
11
- isDefaultStyles?: boolean;
12
-
13
- wrapperClass?: string;
14
- itemListClass?: string;
15
- itemClass?: string;
16
- selectedItemClass?: string;
17
- disableItemClass?: string;
18
-
19
- className?: string;
20
- }
21
-
22
- const Pagination: FC<PaginationProps> = ({
23
- paginationStart,
24
- currentIndex,
25
- totalPages,
26
- setIndex,
27
- isDefaultStyles,
28
-
29
- wrapperClass = "",
30
- itemListClass = "",
31
- itemClass = "",
32
- selectedItemClass = "",
33
- disableItemClass = "",
34
- className,
35
- }) => {
36
- if (totalPages <= 1) {
37
- return (
38
- <Wrapper wrapperClass={className ? className : wrapperClass} isDefaultStyles={isDefaultStyles}>
39
- <ItemList itemListClass={itemListClass} isDefaultStyles={isDefaultStyles}>
40
- <Item
41
- itemClass={disableItemClass}
42
- itemStyle={defaultStylesEnum.disableItemClass}
43
- isDefaultStyles={isDefaultStyles}
44
- >
45
- {`<<`}
46
- </Item>
47
-
48
- <Item
49
- itemClass={disableItemClass}
50
- itemStyle={defaultStylesEnum.disableItemClass}
51
- isDefaultStyles={isDefaultStyles}
52
- >
53
- 1
54
- </Item>
55
-
56
- <Item
57
- itemClass={disableItemClass}
58
- itemStyle={defaultStylesEnum.disableItemClass}
59
- isDefaultStyles={isDefaultStyles}
60
- >
61
- {`>>`}
62
- </Item>
63
- </ItemList>
64
- </Wrapper>
65
- );
66
- }
67
-
68
- if (totalPages > 1 && totalPages < 4) {
69
- return (
70
- <Wrapper wrapperClass={className ? className : wrapperClass} isDefaultStyles={isDefaultStyles}>
71
- <ItemList itemListClass={itemListClass} isDefaultStyles={isDefaultStyles}>
72
- {range(totalPages).map((el) => {
73
- const index = paginationStart === 0 ? el : el + 1;
74
- if (currentIndex === index) {
75
- return (
76
- <Item
77
- itemClass={selectedItemClass}
78
- itemStyle={defaultStylesEnum.selectedItemClass}
79
- isDefaultStyles={isDefaultStyles}
80
- key={el}
81
- >
82
- {el + 1}
83
- </Item>
84
- );
85
- }
86
- return (
87
- <Item
88
- itemClass={selectedItemClass}
89
- itemStyle={defaultStylesEnum.itemClass}
90
- isDefaultStyles={isDefaultStyles}
91
- onClick={() => setIndex(index)}
92
- key={el}
93
- >
94
- {el + 1}
95
- </Item>
96
- );
97
- })}
98
- </ItemList>
99
- </Wrapper>
100
- );
101
- }
102
-
103
- if (totalPages === 4) {
104
- return (
105
- <Wrapper wrapperClass={className ? className : wrapperClass} isDefaultStyles={isDefaultStyles}>
106
- <ItemList itemListClass={itemListClass} isDefaultStyles={isDefaultStyles}>
107
- {currentIndex > (paginationStart === 0 ? 0 : 1) ? (
108
- <Item
109
- itemClass={itemClass}
110
- itemStyle={defaultStylesEnum.itemClass}
111
- isDefaultStyles={isDefaultStyles}
112
- onClick={() => setIndex(currentIndex - 1)}
113
- >
114
- {`<<`}
115
- </Item>
116
- ) : (
117
- <Item
118
- itemClass={disableItemClass}
119
- itemStyle={defaultStylesEnum.disableItemClass}
120
- isDefaultStyles={isDefaultStyles}
121
- >
122
- {`<<`}
123
- </Item>
124
- )}
125
- {range(totalPages).map((el) => {
126
- const index = paginationStart === 0 ? el : el + 1;
127
- if (currentIndex === index) {
128
- return (
129
- <Item
130
- itemClass={selectedItemClass}
131
- itemStyle={defaultStylesEnum.selectedItemClass}
132
- isDefaultStyles={isDefaultStyles}
133
- key={el}
134
- >
135
- {el + 1}
136
- </Item>
137
- );
138
- }
139
- return (
140
- <Item
141
- itemClass={selectedItemClass}
142
- itemStyle={defaultStylesEnum.itemClass}
143
- isDefaultStyles={isDefaultStyles}
144
- key={el}
145
- onClick={() => setIndex(index)}
146
- >
147
- {el + 1}
148
- </Item>
149
- );
150
- })}
151
- {currentIndex < (paginationStart === 0 ? 3 : 4) ? (
152
- <Item
153
- itemClass={itemClass}
154
- itemStyle={defaultStylesEnum.itemClass}
155
- isDefaultStyles={isDefaultStyles}
156
- onClick={() => setIndex(currentIndex + 1)}
157
- >
158
- {`>>`}
159
- </Item>
160
- ) : (
161
- <Item
162
- itemClass={disableItemClass}
163
- itemStyle={defaultStylesEnum.disableItemClass}
164
- isDefaultStyles={isDefaultStyles}
165
- >
166
- {`>>`}
167
- </Item>
168
- )}
169
- </ItemList>
170
- </Wrapper>
171
- );
172
- }
173
-
174
- return (
175
- <Wrapper wrapperClass={className ? className : wrapperClass} isDefaultStyles={isDefaultStyles}>
176
- <ItemList itemListClass={itemListClass} isDefaultStyles={isDefaultStyles}>
177
- {/*Previous button*/}
178
- {currentIndex > (paginationStart === 0 ? 0 : 1) ? (
179
- <Item
180
- itemClass={itemClass}
181
- itemStyle={defaultStylesEnum.itemClass}
182
- isDefaultStyles={isDefaultStyles}
183
- onClick={() => setIndex(currentIndex - 1)}
184
- >
185
- {`<<`}
186
- </Item>
187
- ) : (
188
- <Item
189
- itemClass={disableItemClass}
190
- itemStyle={defaultStylesEnum.disableItemClass}
191
- isDefaultStyles={isDefaultStyles}
192
- >
193
- {`<<`}
194
- </Item>
195
- )}
196
- {/*First page button*/}
197
- {currentIndex > (paginationStart == 0 ? 2 : 3) ? (
198
- <Item
199
- itemClass={itemClass}
200
- itemStyle={defaultStylesEnum.itemClass}
201
- isDefaultStyles={isDefaultStyles}
202
- onClick={() => setIndex(paginationStart === 0 ? 0 : 1)}
203
- >
204
- {`1`}
205
- </Item>
206
- ) : null}
207
-
208
- {currentIndex < (paginationStart === 0 ? 3 : 4)
209
- ? range(4).map((el) => {
210
- const index = paginationStart === 0 ? el : el + 1;
211
- if (currentIndex === index) {
212
- return (
213
- <Item
214
- itemClass={selectedItemClass}
215
- itemStyle={defaultStylesEnum.selectedItemClass}
216
- isDefaultStyles={isDefaultStyles}
217
- key={el}
218
- >
219
- {el + 1}
220
- </Item>
221
- );
222
- }
223
- return (
224
- <Item
225
- itemClass={itemClass}
226
- itemStyle={defaultStylesEnum.itemClass}
227
- isDefaultStyles={isDefaultStyles}
228
- onClick={() => setIndex(index)}
229
- key={el}
230
- >
231
- {el + 1}
232
- </Item>
233
- );
234
- })
235
- : null}
236
-
237
- {currentIndex > (paginationStart === 0 ? 2 : 3) ? (
238
- <Item
239
- itemClass={disableItemClass}
240
- itemStyle={defaultStylesEnum.disableItemClass}
241
- isDefaultStyles={isDefaultStyles}
242
- >
243
- {`...`}
244
- </Item>
245
- ) : null}
246
-
247
- {currentIndex > (paginationStart === 0 ? 2 : 3) &&
248
- (paginationStart === 0 ? currentIndex : currentIndex - 1) < totalPages ? (
249
- <>
250
- {currentIndex === (paginationStart === 0 ? totalPages - 2 : totalPages - 1) && (
251
- <Item
252
- itemClass={itemClass}
253
- itemStyle={defaultStylesEnum.itemClass}
254
- isDefaultStyles={isDefaultStyles}
255
- onClick={() => setIndex(paginationStart === 0 ? totalPages - 4 : totalPages - 3)}
256
- >
257
- {totalPages - 3}
258
- </Item>
259
- )}
260
-
261
- {currentIndex === (paginationStart === 0 ? totalPages - 1 : totalPages) && (
262
- <>
263
- <Item
264
- itemClass={itemClass}
265
- itemStyle={defaultStylesEnum.itemClass}
266
- isDefaultStyles={isDefaultStyles}
267
- onClick={() => setIndex(paginationStart === 0 ? totalPages - 4 : totalPages - 3)}
268
- >
269
- {totalPages - 3}
270
- </Item>
271
- <Item
272
- itemClass={itemClass}
273
- itemStyle={defaultStylesEnum.itemClass}
274
- isDefaultStyles={isDefaultStyles}
275
- onClick={() => setIndex(paginationStart === 0 ? totalPages - 3 : totalPages - 2)}
276
- >
277
- {totalPages - 2}
278
- </Item>
279
- </>
280
- )}
281
-
282
- <Item
283
- itemClass={itemClass}
284
- itemStyle={defaultStylesEnum.itemClass}
285
- isDefaultStyles={isDefaultStyles}
286
- onClick={() => setIndex(currentIndex - 1)}
287
- >
288
- {paginationStart === 0 ? currentIndex : currentIndex - 1}
289
- </Item>
290
-
291
- <Item
292
- itemClass={selectedItemClass}
293
- itemStyle={defaultStylesEnum.selectedItemClass}
294
- isDefaultStyles={isDefaultStyles}
295
- >
296
- {paginationStart === 0 ? currentIndex + 1 : currentIndex}
297
- </Item>
298
-
299
- {currentIndex < (paginationStart === 0 ? totalPages - 1 : totalPages) ? (
300
- <Item
301
- itemClass={itemClass}
302
- itemStyle={defaultStylesEnum.itemClass}
303
- isDefaultStyles={isDefaultStyles}
304
- onClick={() => setIndex(currentIndex + 1)}
305
- >
306
- {paginationStart === 0 ? currentIndex + 2 : currentIndex + 1}
307
- </Item>
308
- ) : null}
309
- </>
310
- ) : null}
311
-
312
- {currentIndex < (paginationStart === 0 ? totalPages - 3 : totalPages - 2) ? (
313
- <Item
314
- itemClass={disableItemClass}
315
- itemStyle={defaultStylesEnum.disableItemClass}
316
- isDefaultStyles={isDefaultStyles}
317
- >
318
- {`...`}
319
- </Item>
320
- ) : null}
321
-
322
- {currentIndex < (paginationStart === 0 ? totalPages - 2 : totalPages - 1) ? (
323
- <Item
324
- itemClass={itemClass}
325
- itemStyle={defaultStylesEnum.itemClass}
326
- isDefaultStyles={isDefaultStyles}
327
- onClick={() => setIndex(paginationStart === 0 ? totalPages - 1 : totalPages)}
328
- >
329
- {totalPages}
330
- </Item>
331
- ) : null}
332
-
333
- {(paginationStart === 0 ? currentIndex + 1 : currentIndex) < totalPages ? (
334
- <Item
335
- itemClass={itemClass}
336
- itemStyle={defaultStylesEnum.itemClass}
337
- isDefaultStyles={isDefaultStyles}
338
- onClick={() => setIndex(currentIndex + 1)}
339
- >
340
- {`>>`}
341
- </Item>
342
- ) : (
343
- <Item
344
- itemClass={disableItemClass}
345
- itemStyle={defaultStylesEnum.disableItemClass}
346
- isDefaultStyles={isDefaultStyles}
347
- >
348
- {`>>`}
349
- </Item>
350
- )}
351
- </ItemList>
352
- </Wrapper>
353
- );
354
- };
355
-
356
- export default Pagination;