Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 15500 Rev 15501
Línea 1... Línea 1...
1
import React from 'react'
1
import React from 'react'
2
import styled from 'styled-components'
2
import styled from 'styled-components'
3
import { Pagination } from 'react-bootstrap'
3
import Pagination from 'react-bootstrap/Pagination'
Línea 4... Línea 4...
4
 
4
 
5
const StyledDefaultPagination = styled(Pagination)`
5
const StyledPagination = styled(Pagination)`
6
  display: flex;
6
  display: flex;
7
  justify-content: center;
7
  justify-content: center;
8
  align-items: center;
8
  align-items: center;
9
  flex-direction: inherit !important;
-
 
10
  position: inherit !important;
-
 
11
  transform: inherit !important;
-
 
12
`
-
 
13
const StyledRowPagination = styled(Pagination)`
-
 
14
  display: flex;
-
 
15
  justify-content: center;
-
 
16
  align-items: center;
-
 
17
  flex-direction: initial !important;
9
  flex-direction: ${props => props.isRow ? 'row' : 'column'} !important;
18
  position: inherit !important;
10
  position: inherit !important;
-
 
11
  transform: inherit !important;
-
 
12
  top: inherit !important;
19
  transform: inherit !important;
13
  left: inherit !important;
Línea 20... Línea 14...
20
`
14
`
21
 
15
 
22
const PaginationComponent = ({ pages = 1, currentActivePage = 1, onChangePage, isRow = true }) => {
-
 
23
	const currentPage = currentActivePage
16
const PaginationComponent = ({ pages = 1, currentActivePage = 1, onChangePage, isRow = true }) => {
24
	const StyledPagination = isRow ? StyledRowPagination : StyledDefaultPagination
17
	const currentPage = currentActivePage
25
	const nextPages = []
18
	const nextPages = []
Línea 26... Línea 19...
26
	const previousPages = []
19
	const previousPages = []
Línea 66... Línea 59...
66
	generateCurrentPages()
59
	generateCurrentPages()
Línea 67... Línea 60...
67
 
60
 
Línea 68... Línea 61...
68
	if (pages <= 1) return null
61
	if (pages <= 1) return null
69
 
62
 
70
	return (
63
	return (
71
		<StyledPagination>
64
		<StyledPagination isRow={isRow}>
72
			<Pagination.Prev
65
			<Pagination.Prev
73
				disabled={currentPage - 1 <= 0}
66
				disabled={currentPage - 1 <= 0}
74
				onClick={previousPageHandler}
67
				onClick={previousPageHandler}