| Línea 1... |
Línea 1... |
| 1 |
import React, { useState, useRef, useEffect } from "react";
|
1 |
import React, { useState, useRef, useEffect } from "react";
|
| 2 |
import { axios, jsonToParams } from "../../utils";
|
2 |
import { axios, jsonToParams } from "../../utils";
|
| 3 |
import { Col, Container, Row } from "react-bootstrap";
|
3 |
import { Col, Container, Row } from "react-bootstrap";
|
| 4 |
import { useHistory, useLocation } from "react-router-dom";
|
4 |
import { useHistory, useLocation } from "react-router-dom";
|
| 5 |
import styled from "styled-components";
|
- |
|
| 6 |
import SearchIcon from "@mui/icons-material/Search";
|
5 |
import SearchIcon from "@mui/icons-material/Search";
|
| Línea 7... |
Línea 6... |
| 7 |
|
6 |
|
| 8 |
import Spinner from "../../components/UI/Spinner";
|
7 |
import Spinner from "../../components/UI/Spinner";
|
| 9 |
import SearchItem from "../../components/search/SearchItem";
|
8 |
import SearchItem from "../../components/search/SearchItem";
|
| Línea 12... |
Línea 11... |
| 12 |
import PaginationComponent from "../../components/UI/PaginationComponent";
|
11 |
import PaginationComponent from "../../components/UI/PaginationComponent";
|
| 13 |
import FiltersSidebar from "../../components/search/FiltersSidebar";
|
12 |
import FiltersSidebar from "../../components/search/FiltersSidebar";
|
| 14 |
import CategoryFilter from "../../components/search/CategoryFilter";
|
13 |
import CategoryFilter from "../../components/search/CategoryFilter";
|
| 15 |
import LocationFilter from "../../components/search/LocationFilter";
|
14 |
import LocationFilter from "../../components/search/LocationFilter";
|
| Línea 16... |
Línea -... |
| 16 |
|
- |
|
| 17 |
const StyledSearch = styled(Input)`
|
- |
|
| 18 |
background-color: var(--bg-color);
|
- |
|
| 19 |
`;
|
- |
|
| 20 |
|
15 |
|
| 21 |
const SearchPage = () => {
|
16 |
const SearchPage = () => {
|
| 22 |
const [entities, setEntities] = useState([]);
|
17 |
const [entities, setEntities] = useState([]);
|
| 23 |
const [loading, setLoading] = useState(true);
|
18 |
const [loading, setLoading] = useState(true);
|
| 24 |
const [category, setCategory] = useState("user");
|
19 |
const [category, setCategory] = useState("user");
|
| Línea 165... |
Línea 160... |
| 165 |
}, [keyword, category, currentPage]);
|
160 |
}, [keyword, category, currentPage]);
|
| Línea 166... |
Línea 161... |
| 166 |
|
161 |
|
| 167 |
return (
|
162 |
return (
|
| 168 |
<>
|
163 |
<>
|
| 169 |
<Container as="main">
|
164 |
<Container as="main">
|
| 170 |
<StyledSearch
|
165 |
<Input
|
| 171 |
icon={SearchIcon}
|
166 |
icon={SearchIcon}
|
| 172 |
onKeyDown={onSearch}
|
167 |
onKeyDown={onSearch}
|
| 173 |
onChange={(e) => setEntity(e.target.value)}
|
168 |
onChange={(e) => setEntity(e.target.value)}
|
| 174 |
value={entity}
|
169 |
value={entity}
|