Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 3837 Rev 3921
Línea 4... Línea 4...
4
import { axios } from "../../../utils";
4
import { axios } from "../../../utils";
Línea 5... Línea 5...
5
 
5
 
6
const PeopleYouMayKnow = () => {
6
const PeopleYouMayKnow = () => {
7
  // states
7
  // states
8
  const [peopleYouMayKnow, setPeopleYouMayKnow] = useState([]);
-
 
9
  const [error, setError] = useState("");
8
  const [peopleYouMayKnow, setPeopleYouMayKnow] = useState([]);
Línea 10... Línea 9...
10
  const dispatch = useDispatch()
9
  const dispatch = useDispatch()
11
 
10
 
12
  const handleConnect = (url) => {
11
  const handleConnect = (url) => {
Línea 38... Línea 37...
38
  }
37
  }
Línea 39... Línea 38...
39
 
38
 
Línea 40... Línea 39...
40
  useEffect(() => getSuggestion(), []);
39
  useEffect(() => getSuggestion(), []);
41
 
40
 
42
  return (
41
  return (
43
    <div className='peopleYouMayKnow' id="suggestions-list-people-you-may-know">
42
    <div className='peopleYouMayKnow'>
44
      <div className="sd-title d-flex align-items-center justify-content-between">
-
 
45
        <h3>Conecta con:</h3>
43
      <div className="sd-title d-flex align-items-center justify-content-between">
46
        {!error &&
44
        <h3>Conecta con:</h3>
47
          <a href="/connection/people-you-may-know" target="_blank">
45
        <a href="/connection/people-you-may-know" target="_blank">
48
            Ver más
-
 
49
          </a>
46
          Ver más
50
        }
47
        </a>
51
      </div>
48
      </div>
52
      <div className='suggest-list'>
-
 
53
        {peopleYouMayKnow.length
-
 
54
          ? <React.Fragment>
-
 
55
            {error
49
      <div className='suggest-list'>
56
              ? <div className="suggestion-usd"> Ha ocurrido un error</div>
50
        {peopleYouMayKnow.length
57
              : peopleYouMayKnow.map(({ id, image, link_cancel, link_request, name, profile, relation }) =>
51
          ? peopleYouMayKnow.map(({ id, image, link_cancel, link_request, name, profile }) =>
58
                <div className='user' key={id}>
52
            <div className='user' key={id}>
59
                  <div className="w-100 d-flex align-items-center" style={{ gap: '.5rem' }}>
53
              <div className="w-100 d-flex align-items-center" style={{ gap: '.5rem' }}>
60
                    <a href={profile} target="_blank" rel="noreferrer">
54
                <a href={profile} target="_blank" rel="noreferrer">
61
                      <img src={image} alt={`${name} profile image`} />
55
                  <img src={image} alt={`${name} profile image`} />
62
                    </a>
56
                </a>
63
                    <h4>{name}</h4>
57
                <h4>{name}</h4>
64
                  </div>
58
              </div>
65
                  <div className="w-100 d-flex align-items-center justify-content-start" style={{ gap: '.5rem' }}>
59
              <div className="w-100 d-flex align-items-center justify-content-start" style={{ gap: '.5rem' }}>
66
                    {link_request &&
60
                {link_request &&
67
                      <button
61
                  <button
68
                        className="btn btn-primary"
62
                    className="btn btn-primary"
69
                        onClick={() => handleConnect(link_request)}
63
                    onClick={() => handleConnect(link_request)}
70
                      >
64
                  >
71
                        Conectar
65
                    Conectar
72
                      </button>
66
                  </button>
73
                    }
67
                }
74
                    {link_cancel &&
68
                {link_cancel &&
75
                      <button
69
                  <button
76
                        className="btn btn-secondary"
70
                    className="btn btn-secondary"
77
                        onClick={() => handleConnect(link_cancel)}
71
                    onClick={() => handleConnect(link_cancel)}
78
                      >
72
                  >
79
                        Cancelar
73
                    Cancelar
80
                      </button>
74
                  </button>
81
                    }
75
                }
82
                  </div>
-
 
83
                </div>
76
              </div>
84
              )
-
 
85
            }
77
            </div>
86
          </React.Fragment>
78
          )
87
          : <div className="view-more">Sin sugerencias</div>
79
          : <div className="view-more">Sin sugerencias</div>
88
        }
80
        }
89
      </div>
81
      </div>