Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 1 Rev 1018
Línea 1... Línea 1...
1
import React from "react";
1
import React from "react";
2
import { useState, useRef, useEffect } from "react";
2
import { useState, useRef, useEffect } from "react";
3
import { useLocation } from "react-router-dom";
3
import { useLocation } from "react-router-dom";
4
import { useForm } from "react-hook-form";
4
import { useForm } from "react-hook-form";
5
import {axios, jsonToParams} from "../../../utils";
5
import { axios, jsonToParams } from "../../../utils";
6
import styled from "styled-components";
6
import styled from "styled-components";
7
import Filters from "./filters/Filters";
7
import Filters from "./filters/Filters";
8
import Spinner from "../../../shared/loading-spinner/Spinner";
8
import Spinner from "../../../shared/loading-spinner/Spinner";
9
import EntityTemplate from "../entity-template/EntityTemplate";
9
import EntityTemplate from "../entity-template/EntityTemplate";
10
import PaginationComponent from "../../../shared/pagination/PaginationComponent";
10
import PaginationComponent from "../../../shared/pagination/PaginationComponent";
Línea 37... Línea 37...
37
  const { register, setValue } = useForm();
37
  const { register, setValue } = useForm();
Línea 38... Línea 38...
38
 
38
 
39
  // getting keyword
39
  // getting keyword
40
  const locationParams = new URLSearchParams(location.search);
40
  const locationParams = new URLSearchParams(location.search);
-
 
41
  const keyword = locationParams.get("keyword");
41
  const keyword = locationParams.get("keyword");
42
  
42
  useEffect(async () => {
43
  useEffect(() => {
43
    loadEntities();
44
    loadEntities();
44
    formRef.current.reset();
45
    formRef.current.reset();
45
    if (activeFilters.current.length) activeFilters.current = [];
46
    if (activeFilters.current.length) activeFilters.current = [];
Línea 212... Línea 213...
212
                                onClick={(e) => {
213
                                onClick={(e) => {
213
                                  e.preventDefault;
214
                                  e.preventDefault;
214
                                  setSearchType("user");
215
                                  setSearchType("user");
215
                                }}
216
                                }}
216
                                className={searchType && searchType === 'user' ? 'search-item-selected' : ''}
217
                                className={searchType && searchType === 'user' ? 'search-item-selected' : ''}
217
                                >
218
                              >
218
                                Personas
219
                                Personas
219
                              </a>
220
                              </a>
220
                            </li>
221
                            </li>
221
                            <li>
222
                            <li>
222
                              <a
223
                              <a
Línea 237... Línea 238...
237
                                onClick={(e) => {
238
                                onClick={(e) => {
238
                                  e.preventDefault;
239
                                  e.preventDefault;
239
                                  // searchType.current = "company";
240
                                  // searchType.current = "company";
240
                                  setSearchType("company");
241
                                  setSearchType("company");
241
                                }}
242
                                }}
242
                                >
243
                              >
243
                                Empresas
244
                                Empresas
244
                              </a>
245
                              </a>
245
                            </li>
246
                            </li>
246
                            <li>
247
                            <li>
247
                              <a
248
                              <a