Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev 975 Rev 976
Línea 1... Línea 1...
1
import React, { useState, useEffect } from 'react'
1
import React, { useState, useEffect } from 'react'
2
import { useDispatch, useSelector } from 'react-redux'
2
import { useDispatch, useSelector } from 'react-redux'
3
import { addNotification } from '../../redux/notification/notification.actions'
3
import { addNotification } from '../../redux/notification/notification.actions'
4
import { Col, Container, Row } from 'react-bootstrap'
4
import { Col, Container, Row } from 'react-bootstrap'
5
import { useHistory, useLocation } from 'react-router-dom'
5
import { useHistory, useLocation, useParams } from 'react-router-dom'
6
import { axios, debounce } from '../../utils'
6
import { axios, debounce } from '../../utils'
7
import SearchIcon from '@mui/icons-material/Search'
7
import SearchIcon from '@mui/icons-material/Search'
Línea 8... Línea 8...
8
 
8
 
9
import Input from 'components/UI/Input'
9
import Input from 'components/UI/Input'
Línea 18... Línea 18...
18
const SearchPage = () => {
18
const SearchPage = () => {
19
  const [entities, setEntities] = useState([])
19
  const [entities, setEntities] = useState([])
20
  const [loading, setLoading] = useState(true)
20
  const [loading, setLoading] = useState(true)
21
  const [address, setAddress] = useState({})
21
  const [address, setAddress] = useState({})
22
  const [pages, setPages] = useState(1)
22
  const [pages, setPages] = useState(1)
-
 
23
 
23
  const labels = useSelector(({ intl }) => intl.labels)
24
  const labels = useSelector(({ intl }) => intl.labels)
24
  const { search, pathname } = useLocation()
25
  const { search, pathname } = useLocation()
-
 
26
  const { category } = useParams()
25
  const dispatch = useDispatch()
27
  const dispatch = useDispatch()
26
  const history = useHistory()
28
  const history = useHistory()
Línea 27... Línea 29...
27
 
29
 
28
  const params = new URLSearchParams(search)
30
  const params = new URLSearchParams(search)
Línea 81... Línea 83...
81
        />
83
        />
Línea 82... Línea 84...
82
 
84
 
83
        <Row className='mt-3'>
85
        <Row className='mt-3'>
84
          <Col as='aside' md='4'>
86
          <Col as='aside' md='4'>
-
 
87
            <FiltersSidebar>
-
 
88
              <CategoryFilter
85
            <FiltersSidebar>
89
                currentCategory={category}
-
 
90
                onChange={onChangeCategory}
Línea 86... Línea 91...
86
              <CategoryFilter onChange={onChangeCategory} />
91
              />
87
 
92
 
88
              <LocationFilter
93
              <LocationFilter
89
                onChange={(newAddress) => setAddress(newAddress)}
94
                onChange={(newAddress) => setAddress(newAddress)}
Línea 100... Línea 105...
100
                ))
105
                ))
101
              ) : (
106
              ) : (
102
                <EmptySection message='No hay resultados' />
107
                <EmptySection message='No hay resultados' />
103
              )}
108
              )}
104
            </div>
109
            </div>
-
 
110
 
105
            <PaginationComponent
111
            <PaginationComponent
106
              pages={pages}
112
              pages={pages}
107
              currentActivePage={currentPage}
113
              currentActivePage={currentPage}
108
              onChangePage={onChangePage}
114
              onChangePage={onChangePage}
109
              isRow
115
              isRow