Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev 3416 Rev 3432
Línea 1... Línea 1...
1
import React from "react";
1
import React from 'react'
2
import { useSelector } from "react-redux";
2
import { useSelector } from 'react-redux'
3
import { Search } from "@mui/icons-material";
3
import { Search } from '@mui/icons-material'
4
 
4
 
5
import { debounce } from "@utils";
5
import { debounce } from '@utils'
6
import { useFetch, useSearchQuery } from "@hooks";
6
import { useFetch, useSearchQuery } from '@hooks'
7
 
7
 
8
import Input from "@components/UI/inputs/Input";
8
import Input from '@components/UI/inputs/Input'
9
import TitleSection from "@components/UI/TitleSection";
9
import TitleSection from '@components/UI/TitleSection'
10
import Pagination from "@components/common/Pagination";
10
import Pagination from '@components/common/Pagination'
11
import PeopleYouMayKnowList from "@components/connections/PeopleYouMayKnowList";
11
import PeopleYouMayKnowList from '@components/connections/PeopleYouMayKnowList'
Línea 12... Línea 12...
12
 
12
 
13
const PeopleYouMayKnowPage = () => {
13
const PeopleYouMayKnowPage = () => {
Línea 14... Línea 14...
14
  const labels = useSelector(({ intl }) => intl.labels);
14
  const labels = useSelector(({ intl }) => intl.labels)
15
 
15
 
16
  const { getStringParams, setParam } = useSearchQuery();
16
  const { getStringParams, setParam } = useSearchQuery()
17
  const { data, loading, refetch } = useFetch(
17
  const { data, isLoading, refetch } = useFetch(
Línea 18... Línea 18...
18
    "/connection/people-you-may-know" + getStringParams()
18
    '/connection/people-you-may-know' + getStringParams()
Línea 19... Línea 19...
19
  );
19
  )
20
 
20
 
21
  const handleSearch = debounce((e) => setParam("search", e.target.value));
21
  const handleSearch = debounce((e) => setParam('search', e.target.value))
22
 
22
 
23
  return (
23
  return (
24
    <>
24
    <>
25
      <TitleSection title={labels.people_you_may_know} />
25
      <TitleSection title={labels.people_you_may_know} />
26
      <Input icon={<Search />} onChange={handleSearch} variant="search" />
26
      <Input icon={<Search />} onChange={handleSearch} variant='search' />
27
      <PeopleYouMayKnowList
27
      <PeopleYouMayKnowList
Línea 28... Línea 28...
28
        connections={data.current?.items}
28
        connections={data.current?.items}
29
        loading={loading}
29
        loading={isLoading}
30
        onComplete={refetch}
30
        onComplete={refetch}
31
      />
31
      />
32
 
32
 
33
      <Pagination
33
      <Pagination
34
        pages={data.total?.pages}
34
        pages={data.total?.pages}
35
        page={data.current?.page}
35
        page={data.current?.page}
Línea 36... Línea 36...
36
        onChange={(page) => setParam("page", page)}
36
        onChange={(page) => setParam('page', page)}