File tree Expand file tree Collapse file tree 2 files changed +4
-27
lines changed Expand file tree Collapse file tree 2 files changed +4
-27
lines changed Original file line number Diff line number Diff line change @@ -143,10 +143,7 @@ const ViewTestimony = (
143
143
) ) }
144
144
145
145
{ ( pagination . hasPreviousPage || pagination . hasNextPage ) && (
146
- < PaginationButtons
147
- pagination = { pagination }
148
- totalItems = { totalTestimonies }
149
- />
146
+ < PaginationButtons pagination = { pagination } />
150
147
) }
151
148
</ div >
152
149
) : (
Original file line number Diff line number Diff line change 1
1
import {
2
- faAngleLeft ,
3
- faAngleRight ,
4
2
faAngleDoubleLeft ,
5
3
faAngleDoubleRight
6
4
} from "@fortawesome/free-solid-svg-icons"
@@ -16,21 +14,13 @@ export const PaginationButtons = ({
16
14
nextPage,
17
15
hasNextPage,
18
16
previousPage,
19
- hasPreviousPage,
20
- itemsPerPage
21
- } ,
22
- totalItems
17
+ hasPreviousPage
18
+ }
23
19
} : {
24
20
pagination : Pagination
25
- totalItems : number | undefined
26
21
} ) => {
27
22
const { t } = useTranslation ( "common" )
28
23
29
- if ( totalItems === undefined ) {
30
- return null
31
- }
32
- let currentPageEnd = Math . min ( currentPage * itemsPerPage , totalItems )
33
-
34
24
return (
35
25
< div className = "d-flex justify-content-center my-3" >
36
26
< PreviousStyle
@@ -43,23 +33,13 @@ export const PaginationButtons = ({
43
33
< SpanStyle variant = "secondary" className = "align-self-center" >
44
34
{ t ( "table.page" , { currentPage } ) }
45
35
</ SpanStyle >
46
- < NextStyle
47
- variant = "secondary"
48
- onClick = { nextPage }
49
- disabled = { ! hasNextPage || currentPageEnd >= totalItems }
50
- >
36
+ < NextStyle variant = "secondary" onClick = { nextPage } disabled = { ! hasNextPage } >
51
37
< FontAwesomeIcon icon = { faAngleDoubleRight } />
52
38
</ NextStyle >
53
39
</ div >
54
40
)
55
41
}
56
42
57
- const SetPageStyle = styled ( Button ) `
58
- font-family: nunito;
59
- background-color: #1a3185;
60
- margin: 2px;
61
- border-radius: 0;
62
- `
63
43
const SpanStyle = styled ( Button ) `
64
44
background-color: #1a3185;
65
45
color: white;
You can’t perform that action at this time.
0 commit comments