Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 3416 | Rev 3435 | 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, { useState } from "react";
1
import React, { useState } 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 AddProfileModal from "@components/modals/AddProfileModal";
10
import AddProfileModal from '@components/modals/AddProfileModal'
11
import MyProfilesList from "@components/profile/MyProfilesList";
11
import MyProfilesList from '@components/profile/MyProfilesList'
Línea 12... Línea 12...
12
 
12
 
13
const MyProfilesPage = () => {
13
const MyProfilesPage = () => {
Línea 14... Línea 14...
14
  const [isShowAddModal, setIsShowAddModal] = useState(false);
14
  const [isShowAddModal, setIsShowAddModal] = useState(false)
Línea 15... Línea 15...
15
 
15
 
Línea 16... Línea 16...
16
  const toggleModal = () => setIsShowAddModal(!isShowAddModal);
16
  const toggleModal = () => setIsShowAddModal(!isShowAddModal)
17
 
17
 
18
  const labels = useSelector(({ intl }) => intl.labels);
18
  const labels = useSelector(({ intl }) => intl.labels)
19
 
19
 
Línea 20... Línea 20...
20
  const { getStringParams, setParam } = useSearchQuery();
20
  const { getStringParams, setParam } = useSearchQuery()
Línea 21... Línea 21...
21
  const { data, loading, refetch } = useFetch(
21
  const { data, isLoading, refetch } = useFetch(
22
    "/profile/my-profiles" + getStringParams()
22
    '/profile/my-profiles' + getStringParams()
23
  );
23
  )
24
 
24
 
25
  const handleSearch = debounce((e) => setParam("search", e.target.value));
25
  const handleSearch = debounce((e) => setParam('search', e.target.value))
26
 
26
 
27
  return (
27
  return (
28
    <>
28
    <>
-
 
29
      <TitleSection
-
 
30
        title={labels.my_profiles}
-
 
31
        onAdd={toggleModal}
29
      <TitleSection
32
        addLabel={labels.add}
-
 
33
      />
30
        title={labels.my_profiles}
34
      <Input icon={<Search />} onChange={handleSearch} variant='search' />
31
        onAdd={toggleModal}
35
      <MyProfilesList
32
        addLabel={labels.add}
36
        profiles={data}
33
      />
37
        loading={isLoading}
34
      <Input icon={<Search />} onChange={handleSearch} variant="search" />
38
        onComplete={refetch}
35
      <MyProfilesList profiles={data} loading={loading} onComplete={refetch} />
39
      />
36
      <AddProfileModal
40
      <AddProfileModal
37
        show={isShowAddModal}
41
        show={isShowAddModal}
Línea 38... Línea 42...
38
        getProfiles={() => refetch()}
42
        getProfiles={() => refetch()}