Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

Rev 4538 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 4538 Rev 6862
Línea 1... Línea 1...
1
/* eslint-disable react/prop-types */
1
/* eslint-disable react/prop-types */
2
import React, { useEffect, useState } from "react";
2
import React, { useEffect, useState } from 'react'
3
import { axios } from "../../../../../utils";
3
import { axios } from '../../../../../utils'
4
import EastIcon from '@mui/icons-material/East';
4
import EastIcon from '@mui/icons-material/East'
5
import MembersModal from '../../../../../shared/helpers/group-members-helper/MembersModal'
5
import MembersModal from '../../../../../shared/helpers/group-members-helper/MembersModal'
6
import Avatar from '../../../../../shared/Avatar/Avatar'
6
import Avatar from '../../../../../shared/Avatar/Avatar'
Línea 7... Línea 7...
7
 
7
 
8
const CompanyFollowers = ({ companyId }) => {
8
const CompanyFollowers = ({ companyId }) => {
9
    const [followers, setFollowers] = useState([])
9
  const [followers, setFollowers] = useState([])
Línea 10... Línea 10...
10
    const [showMembersModal, setShowMembersModal] = useState(false);
10
  const [showMembersModal, setShowMembersModal] = useState(false)
11
 
11
 
12
    const load = () => {
-
 
13
        axios.get(`/helpers/company-follower/${companyId}`)
12
  useEffect(() => {
14
            .then(({ data }) => {
13
    axios.get(`/helpers/company-follower/${companyId}`).then(({ data }) => {
15
                if (data.success) setFollowers(data.data)
14
      if (data.success) setFollowers(data.data)
16
            })
-
 
17
    }
-
 
18
 
15
    })
19
    useEffect(() => load(), []);
16
  }, [])
20
 
17
 
21
    const openModal = (e) => {
18
  const openModal = (e) => {
22
        e.preventDefault();
19
    e.preventDefault()
23
        setShowMembersModal(true)
20
    setShowMembersModal(true)
24
    }
21
  }
25
 
22
 
26
    return (
23
  return (
27
        <>
24
    <>
28
            <MembersModal
25
      <MembersModal
29
                isShow={showMembersModal}
26
        isShow={showMembersModal}
30
                handleClose={() => setShowMembersModal(!showMembersModal)}
27
        handleClose={() => setShowMembersModal(!showMembersModal)}
31
                members={followers}
28
        members={followers}
32
                handleAction={() => null}
29
        handleAction={() => null}
33
            />
30
      />
34
            <div className='suggest__widget'>
31
      <div className="suggest__widget">
35
                <div className="linked__widget-header">
32
        <div className="linked__widget-header">
36
                    <h3>{followers.length} Seguidores</h3>
33
          <h3>{followers.length} Seguidores</h3>
37
                </div>
34
        </div>
-
 
35
        <div className="members-image__list">
38
                <div className="members-image__list">
36
          {followers.slice(0, 4).map((member) => {
39
                    {followers.slice(0, 4).map((member) => {
37
            return (
40
                        return <Avatar
38
              <Avatar
41
                            key={member.name}
39
                key={member.name}
42
                            imageUrl={member.image}
40
                imageUrl={member.image}
43
                            size='lg'
41
                size="lg"
-
 
42
                name={member.name}
44
                            name={member.name}
43
              />
45
                        />
44
            )
46
                    })}
45
          })}
47
                </div>
46
        </div>
48
                <a className="load__suggest" onClick={(e) => openModal(e)}>
47
        <a className="load__suggest" onClick={(e) => openModal(e)}>
49
                    <span>Ver más</span>
48
          <span>Ver más</span>
50
                    <EastIcon />
49
          <EastIcon />
51
                </a>
50
        </a>
52
            </div>
51
      </div>
53
        </>
52
    </>
Línea 54... Línea 53...
54
    );
53
  )