Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 2443 Rev 2943
Línea 1... Línea 1...
1
import React from "react";
1
import React from "react";
2
import { useEffect, useState } from "react";
2
import { useEffect, useState } from "react";
3
import { axios } from "../../../utils";
3
import { axios } from "../../../utils";
-
 
4
import styles from "../../../shared/helpers/people-you-may-know/peopleYouMayKnow.module.scss";
Línea 4... Línea 5...
4
 
5
 
5
const CompanyFollowersHelper = (props) => {
6
const CompanyFollowersHelper = (props) => {
6
  // props destructuring
7
  // props destructuring
Línea 21... Línea 22...
21
  }, []);
22
  }, []);
Línea 22... Línea 23...
22
 
23
 
23
  const getData = () => {
24
  const getData = () => {
24
    let infoFollows = [...companyFollowers]
25
    let infoFollows = [...companyFollowers]
25
    if (!lookMore) {
26
    if (!lookMore) {
26
      infoFollows = infoFollows.slice(0, 5);
27
      infoFollows = infoFollows.slice(0, 3);
27
    }
28
    }
28
    return infoFollows
29
    return infoFollows
29
  }
30
  }
30
  return (
-
 
31
    <div
31
  return (
-
 
32
    <div className="widget suggestions d-none d-md-block d-lg-block">
-
 
33
      <div className="sd-title d-flex align-items-center justify-content-between">
-
 
34
        <h3>Seguidores:</h3>
-
 
35
        <div className="w-100 text-center">
32
      className="widget suggestions full-width d-none d-md-block d-lg-block border-gray border-radius"
36
          <a href="#"
-
 
37
            className="btn btn-primary"
-
 
38
            onClick={(e) => {
33
      id="suggestions-similar-groups"
39
              e.preventDefault()
-
 
40
              setLookMore(!lookMore)
34
      style={{ height: "auto", overflowY: "auto", }}
41
            }}
35
    >
42
          >
-
 
43
            {lookMore ? 'Ver menos' : 'Ver mas'}
36
      <div className="sd-title font-weight-bold">
44
          </a>
37
        <h3>Seguidores</h3>
45
        </div>
38
      </div>
46
      </div>
39
      <div className="mb-2" id="suggestions-similar-groups" style={{ height: '80%', overflowY: 'auto' }}>
47
      <div className="mb-2" id="suggestions-similar-groups" style={{ height: '80%', overflowY: 'auto' }}>
40
        {companyFollowers.length
48
        {companyFollowers.length
41
          ? getData().map(({ id, name, image, profile }) => (
-
 
42
            <div key={id} className="suggestion-usd d-flex justify-content-start align-items-center">
-
 
43
              <img
49
          ? getData().map(({ id, name, image, profile }) => (
44
                style={{ width: "10%", height: "auto" }}
-
 
45
                src={image}
-
 
46
                alt=""
-
 
47
              />
50
            <div className={styles.user} key={id}>
48
              <div className="sgt-text">
51
              <div className="w-100 d-flex align-items-center" style={{ gap: '.5rem' }}>
-
 
52
                <a href={profile} target="_blank">
-
 
53
                  <img src={image} alt={`${name} profile image`} />
49
                <a href={profile} target="_blank">
54
                </a>
-
 
55
                <h4>{name}</h4>
-
 
56
              </div>
-
 
57
              <div className="w-100 d-flex align-items-center justify-content-start" style={{ gap: '.5rem' }}>
-
 
58
                <a
-
 
59
                  href={profile}
-
 
60
                  className="btn btn-primary"
-
 
61
                  target='_blank'
-
 
62
                  rel="noreferrer"
-
 
63
                  style={{ fontSize: '.9rem', borderRadius: '4px' }}
-
 
64
                >
50
                  <h4>{name}</h4>
65
                  Ver perfil
51
                </a>
66
                </a>
52
              </div>
67
              </div>
53
            </div>
68
            </div>
54
          ))
69
          ))
55
          : <div className="view-more">Sin seguidores</div>
70
          : <div className="view-more">Sin seguidores</div>
56
        }
71
        }
57
      </div>
-
 
58
      <div className="w-100 text-center">
-
 
59
        <button className="btn btn-primary" onClick={() => setLookMore(!lookMore)}>
-
 
60
          {lookMore ? 'Ver menos' : 'Ver mas'}
-
 
61
        </button>
-
 
62
      </div>
72
      </div>
63
    </div>
73
    </div>
64
  );
74
  );
Línea 65... Línea 75...
65
};
75
};