Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 14164 | Rev 15501 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 14164 Rev 15500
Línea 18... Línea 18...
18
  position: inherit !important;
18
  position: inherit !important;
19
  transform: inherit !important;
19
  transform: inherit !important;
20
`
20
`
Línea 21... Línea 21...
21
 
21
 
22
const PaginationComponent = ({ pages = 1, currentActivePage = 1, onChangePage, isRow = true }) => {
-
 
23
 
22
const PaginationComponent = ({ pages = 1, currentActivePage = 1, onChangePage, isRow = true }) => {
24
	const currentPage = currentActivePage
23
	const currentPage = currentActivePage
25
	const StyledPagination = isRow ? StyledRowPagination : StyledDefaultPagination
-
 
26
	// const pages = 10;
24
	const StyledPagination = isRow ? StyledRowPagination : StyledDefaultPagination
27
	const nextPages = []
25
	const nextPages = []
28
	const previousPages = []
26
	const previousPages = []
Línea 29... Línea 27...
29
	const maxPages = 5 > pages ? pages : 5
27
	const maxPages = 5 > pages ? pages : 5
Línea 64... Línea 62...
64
	const onClickHandler = (pageToNavigate) => {
62
	const onClickHandler = (pageToNavigate) => {
65
		onChangePage(pageToNavigate)
63
		onChangePage(pageToNavigate)
66
	}
64
	}
Línea 67... Línea 65...
67
 
65
 
-
 
66
	generateCurrentPages()
-
 
67
 
-
 
68
	if (pages <= 1) return null
68
	generateCurrentPages()
69
 
69
	return (
-
 
70
		pages > 1
-
 
71
		&&
70
	return (
72
		<StyledPagination>
71
		<StyledPagination>
73
			<Pagination.Prev
72
			<Pagination.Prev
74
				disabled={currentPage - 1 <= 0}
73
				disabled={currentPage - 1 <= 0}
75
				onClick={previousPageHandler}
74
				onClick={previousPageHandler}
-
 
75
			>
-
 
76
				Anterior
76
			/>
77
			</Pagination.Prev>
77
			{previousPages.map((previousPage) =>
78
			{previousPages.map((previousPage) =>
78
				<Pagination.Item
79
				<Pagination.Item
79
					key={previousPage}
80
					key={previousPage}
80
					onClick={() => onClickHandler(previousPage)}
81
					onClick={() => onClickHandler(previousPage)}
Línea 90... Línea 91...
90
				>
91
				>
91
					{nextPage}
92
					{nextPage}
92
				</Pagination.Item>
93
				</Pagination.Item>
93
			)}
94
			)}
94
			<Pagination.Next
95
			<Pagination.Next
95
				onClick={nextPageHandler}
-
 
96
				disabled={currentPage + 1 > pages}
96
				disabled={currentPage + 1 > pages}
-
 
97
				onClick={nextPageHandler}
97
			/>
98
			>
-
 
99
				Siguiente
-
 
100
			</Pagination.Next>
98
		</StyledPagination>
101
		</StyledPagination>
99
	)
102
	)
100
}
103
}
Línea 101... Línea 104...
101
 
104
 
102
export default PaginationComponent
105
export default PaginationComponent