Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 1777 Rev 2248
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";
Línea 4... Línea 4...
4
 
4
 
5
const SuggestedGroupsHelper = (props) => {
5
const SuggestedGroupsHelper = (props) => {
6
  // props destructuring
6
  // props destructuring
Línea 20... Línea 20...
20
    });
20
    });
21
  }, []);
21
  }, []);
Línea 22... Línea 22...
22
 
22
 
23
  const getData = () => {
23
  const getData = () => {
24
    let infoFollows = [...suggestedGroups]
24
    let infoFollows = [...suggestedGroups]
25
    if(!lookMore){
25
    if (!lookMore) {
26
      infoFollows = infoFollows.slice(0, 5);
26
      infoFollows = infoFollows.slice(0, 5);
27
    }
27
    }
28
    return infoFollows
28
    return infoFollows
29
  }
29
  }
-
 
30
  return (
30
  return (
31
    <div className="right-sidebar border-radius border-gray" style={{ height: "450px" }}>
-
 
32
      <div className="sd-title">
-
 
33
        <h3>Grupos Similares</h3>
31
    <React.Fragment>
34
      </div>
32
      <div
35
      <div
33
        className="widget suggestions full-width"
36
        className="mb-3"
34
        id="suggestions-similar-groups"
-
 
35
        style={{
-
 
36
          height: "450px",
37
        id="suggestions-similar-groups"
37
          overflowY: "auto",
-
 
38
        }}
38
        style={{ height: "80%", overflowY: "auto" }}
39
      >
-
 
40
        <div className="sd-title">
-
 
41
          <h3>Grupos Similares</h3>
-
 
42
        </div>
-
 
43
        {/* <!--sd-title end--> */}
39
      >
44
        {suggestedGroups.length ? (
40
        {suggestedGroups.length ? (
45
          getData().map(({ id, name, image, profile }) => (
41
          getData().map(({ id, name, image, profile }) => (
46
            <div className="suggestion-usd" key={id}>
42
            <div className="suggestion-usd" key={id}>
47
              <div
43
              <div
Línea 70... Línea 66...
70
            </div>
66
            </div>
71
          ))
67
          ))
72
        ) : (
68
        ) : (
73
          <div className="view-more">Sin sugerencias</div>
69
          <div className="view-more">Sin sugerencias</div>
74
        )}
70
        )}
75
        {
-
 
76
          suggestedGroups.length >= 5 && (
-
 
77
            <div
-
 
78
              className="w-100 text-center"
-
 
79
            >
-
 
80
              <button className="btn btn-primary" onClick={() => setLookMore(!lookMore)}>
-
 
81
                {lookMore ? 'Ver menos' : 'Ver mas'}
-
 
82
              </button>
-
 
83
            </div>
-
 
84
          )
-
 
85
        }
-
 
86
      </div>
71
      </div>
-
 
72
      {
-
 
73
        suggestedGroups.length >= 5 && (
-
 
74
          <div className="w-100 text-center">
-
 
75
            <button className="btn btn-primary" onClick={() => setLookMore(!lookMore)}>
-
 
76
              {lookMore ? 'Ver menos' : 'Ver mas'}
87
    </React.Fragment>
77
            </button>
-
 
78
          </div>
-
 
79
        )
-
 
80
      }
-
 
81
    </div>
88
  );
82
  );
89
};
83
};
Línea 90... Línea 84...
90
 
84