Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 4970 Rev 5121
Línea -... Línea 1...
-
 
1
/* eslint-disable camelcase */
1
import React, { useEffect, useState } from "react"
2
import React, { useEffect, useState } from 'react'
2
import { connect } from "react-redux"
3
import { axios } from '../../../utils'
3
import { axios } from "../../../utils"
4
import { connect } from 'react-redux'
4
import { addNotification } from "../../../redux/notification/notification.actions"
5
import { addNotification } from '../../../redux/notification/notification.actions'
5
import Spinner from "../../../shared/loading-spinner/Spinner"
6
import Profile from '../../../components/Profile'
6
import Profile from "../../../components/Profile"
7
import SearchList from '../../../components/SearchList'
7
import SearchList from "../../../components/SearchList"
8
import Spinner from '../../../shared/loading-spinner/Spinner'
8
import PaginationComponent from "../../../shared/pagination/PaginationComponent"
9
import PaginationComponent from '../../../shared/pagination/PaginationComponent'
-
 
10
import EmptySection from '../../../shared/empty-section/EmptySection'
-
 
11
import TitleSection from '../../../components/TitleSection'
Línea 9... Línea 12...
9
 
12
 
10
const MyConnections = () => {
13
const MyConnections = () => {
11
  const [myConnections, setMyConnections] = useState([])
14
  const [myConnections, setMyConnections] = useState([])
12
  const [currentPage, setCurrentPage] = useState(1)
15
  const [currentPage, setCurrentPage] = useState(1)
Línea 30... Línea 33...
30
 
33
 
Línea 31... Línea 34...
31
  const handleChangePage = (newPage) => setCurrentPage(newPage)
34
  const handleChangePage = (newPage) => setCurrentPage(newPage)
32
 
35
 
33
  useEffect(() => {
36
  useEffect(() => {
34
    fetchMyConnections({
37
    fetchMyConnections({
35
      search: search,
38
      search,
36
      page: currentPage
39
      page: currentPage
Línea 37... Línea 40...
37
    })
40
    })
38
  }, [currentPage, search])
41
  }, [currentPage, search])
39
 
42
 
40
  return (
-
 
41
    <section className="companies-info">
43
  return (
42
      <div className="container">
44
    <section className="companies-info">
43
        <SearchList
-
 
44
          title="Personas con Relación directa, de 1er nivel"
45
      <div className="container">
45
          fetchCallback={(value) => setSearch(value)}
46
        <TitleSection title={LABELS.FIRST_LEVEL_PERSONS} />
46
        />
47
        <SearchList onChange={(value) => setSearch(value)}/>
47
        <div className="companies-list" style={{ position: "relative", padding: "0 15px" }}>
48
        <div className="companies-list" style={{ position: 'relative', padding: '0 15px' }}>
48
          {myConnections.length
49
          {myConnections.length
49
            ? myConnections.map(({
50
            ? myConnections.map(({
50
              image,
51
              image,
51
              name,
52
              name,
52
              link_view,
53
              link_view,
53
              link_inmail,
54
              link_inmail,
54
              link_cancel,
55
              link_cancel,
55
              link_block,
56
              link_block
56
            }, id) =>
57
            }, id) =>
57
              <Profile
58
              <Profile
Línea 64... Línea 65...
64
                link_cancel={link_cancel}
65
                link_cancel={link_cancel}
65
                link_block={link_block}
66
                link_block={link_block}
66
                fetchCallback={fetchMyConnections}
67
                fetchCallback={fetchMyConnections}
67
              />
68
              />
68
            )
69
            )
69
            : <p>No hay resultados</p>
70
            : <EmptySection align='left' message={LABELS.DATATABLE_SZERORECORDS}/>
70
          }
71
          }
71
          {loading && <Spinner />}
72
          {loading && <Spinner />}
72
        </div>
73
        </div>
73
        <PaginationComponent
74
        <PaginationComponent
74
          onChangePage={handleChangePage}
75
          onChangePage={handleChangePage}
Línea 80... Línea 81...
80
    </section>
81
    </section>
81
  )
82
  )
82
}
83
}
Línea 83... Línea 84...
83
 
84
 
84
const mapDispatchToProps = {
85
const mapDispatchToProps = {
85
  addNotification: (notification) => addNotification(notification),
86
  addNotification: (notification) => addNotification(notification)
Línea 86... Línea -...
86
}
-
 
87
 
87
}
-
 
88