Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 2945 Rev 3506
Línea -... Línea 1...
-
 
1
/* eslint-disable react/prop-types */
1
import React from "react";
2
import React from "react";
2
import { useEffect, useState } from "react";
3
import { useEffect, useState } from "react";
3
import { axios } from "../../../utils";
4
import { axios } from "../../../utils";
4
import styles from "../../../shared/helpers/people-you-may-know/peopleYouMayKnow.module.scss";
-
 
Línea 5... Línea 5...
5
 
5
 
6
const CompanyFollowersHelper = (props) => {
-
 
7
  // props destructuring
-
 
Línea 8... Línea 6...
8
  const { companyId } = props;
6
const CompanyFollowersHelper = ({ companyId }) => {
9
 
7
 
10
  // states
8
  // states
-
 
9
  const [companyFollowers, setCompanyFollowers] = useState([]);
11
  const [companyFollowers, setCompanyFollowers] = useState([]);
10
  const [lookMore, setLookMore] = useState(false);
12
  const [lookMore, setLookMore] = useState(false);
11
 
13
  useEffect(() => {
-
 
14
    axios.get(`/helpers/company-follower/${companyId}`).then((response) => {
12
  useEffect(() => {
15
      const resData = response.data;
13
    axios.get(`/helpers/company-follower/${companyId}`)
16
      if (resData.success) {
-
 
17
        setCompanyFollowers(resData.data);
-
 
18
      } else {
14
      .then(({ data }) => {
19
        // alert error
-
 
20
      }
15
        if (data.success) setCompanyFollowers(data.data)
Línea 21... Línea 16...
21
    });
16
      })
22
  }, []);
17
  }, []);
23
 
18
 
Línea 42... Línea 37...
42
        </a>
37
        </a>
43
      </div>
38
      </div>
44
      <div className="mb-2" id="suggestions-similar-groups" style={{ height: '80%', overflowY: 'auto' }}>
39
      <div className="mb-2" id="suggestions-similar-groups" style={{ height: '80%', overflowY: 'auto' }}>
45
        {companyFollowers.length
40
        {companyFollowers.length
46
          ? getData().map(({ id, name, image, profile }) => (
41
          ? getData().map(({ id, name, image, profile }) => (
47
            <div className={styles.user} key={id}>
42
            <div className='user' key={id}>
48
              <div className="w-100 d-flex align-items-center" style={{ gap: '.5rem' }}>
43
              <div className="w-100 d-flex align-items-center" style={{ gap: '.5rem' }}>
49
                <a href={profile} target="_blank">
44
                <a href={profile} target="_blank" rel="noreferrer">
50
                  <img src={image} alt={`${name} profile image`} />
45
                  <img src={image} alt={`${name} profile image`} />
51
                </a>
46
                </a>
52
                <h4>{name}</h4>
47
                <h4>{name}</h4>
53
              </div>
48
              </div>
54
              <div className="w-100 d-flex align-items-center justify-content-start" style={{ gap: '.5rem' }}>
49
              <div className="w-100 d-flex align-items-center justify-content-start" style={{ gap: '.5rem' }}>