Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 2924 Rev 2925
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 "../people-you-may-know/peopleYouMayKnow.module.scss";
Línea 4... Línea 5...
4
 
5
 
5
const SuggestedGroupsHelper = (props) => {
6
const SuggestedGroupsHelper = (props) => {
6
  // props destructuring
7
  // props destructuring
Línea 7... Línea 8...
7
  const { groupId } = props;
8
  const { groupId } = props;
8
 
9
 
9
  // states
10
  // states
10
  const [suggestedGroups, setSuggestedGroups] = useState([]);
11
  const [suggestedGroups, setSuggestedGroups] = useState([]);
11
  const [lookMore, setLookMore] = useState(false);
12
  const [lookMore, setLookMore] = useState(false);
12
  useEffect(() => {
13
  useEffect(() => {
13
    const url = groupId ? `/helpers/groups-suggestion/${groupId}` : '/helpers/groups-suggestion'
14
    const url = groupId ? `/helpers/groups-suggestion/${groupId}` : '/helpers/groups-suggestion'
14
    
15
 
15
    axios.get(url)
16
    axios.get(url)
16
      .then(({ data }) => {
17
      .then(({ data }) => {
17
        if (data.success) {
18
        if (data.success) {
Línea 37... Línea 38...
37
        id="suggestions-similar-groups"
38
        id="suggestions-similar-groups"
38
        style={{ height: "80%", overflowY: "auto" }}
39
        style={{ height: "80%", overflowY: "auto" }}
39
      >
40
      >
40
        {suggestedGroups.length ? (
41
        {suggestedGroups.length ? (
41
          getData().map(({ id, name, image, profile }) => (
42
          getData().map(({ id, name, image, profile }) => (
42
            <div className="suggestion-usd" key={id}>
43
            <div className={styles.user} key={id}>
43
              <div
44
              <div className="w-100 d-flex align-items-center" style={{ gap: '.5rem' }}>
44
                className="row"
45
                <a href={profile} target="_blank">
45
              >
46
                  <img src={image} alt={`${name} profile image`} />
46
                <div
47
                </a>
47
                  className="col-md-4 col-sm-12"
-
 
48
                >
48
                <h4>{name}</h4>
49
                  <img
49
              </div>
50
                    style={{ width: "50px", height: "auto" }}
50
              <div className="w-100 d-flex align-items-center justify-content-center" style={{ gap: '.5rem' }}>
51
                    src={image}
-
 
52
                    alt=""
-
 
53
                  />
51
                <a
54
                </div>
52
                  className="btn btn-primary"
55
                <div
53
                  href={profile}
56
                  className="col-8 d-flex align-items-center justify-content-start p-0"
-
 
57
                >
54
                >
58
                  <div className="sgt-text">
-
 
59
                    <h4
-
 
60
                      className="cursor-pointer"
-
 
61
                      onClick={() => window.location.href = profile}
-
 
62
                    >{name}</h4>
-
 
63
                  </div>
55
                  Conectar
64
                </div>
56
                </a>
65
              </div>
57
              </div>
66
            </div>
58
            </div>
67
          ))
59
          ))
68
        ) : (
60
        ) : (
69
          <div className="view-more">Sin sugerencias</div>
61
          <div className="view-more">Sin sugerencias</div>