Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 1 Rev 1158
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 { connect } from "react-redux";
3
import { connect } from "react-redux";
4
import { useForm } from "react-hook-form";
4
import { useForm } from "react-hook-form";
5
import styled from "styled-components";
5
import styled from "styled-components";
6
import {axios} from "../../../utils";
6
import { axios } from "../../../utils";
7
import { addNotification } from "../../../redux/notification/notification.actions";
7
import { addNotification } from "../../../redux/notification/notification.actions";
8
import Spinner from "../../../shared/loading-spinner/Spinner";
8
import Spinner from "../../../shared/loading-spinner/Spinner";
9
import JoinedGroup from "./joined-group/JoinedGroup";
9
import JoinedGroup from "./joined-group/JoinedGroup";
Línea 10... Línea 10...
10
 
10
 
Línea 26... Línea 26...
26
    return () => {
26
    return () => {
27
      clearTimeout(axiosThrottle);
27
      clearTimeout(axiosThrottle);
28
    };
28
    };
29
  }, []);
29
  }, []);
Línea 30... Línea 30...
30
 
30
 
31
  const fetchJoinedGroups = async (searchParam='') => {
31
  const fetchJoinedGroups = async (searchParam = '') => {
32
    setLoading(true);
32
    setLoading(true);
33
    await axios
33
    await axios
34
      .get(
34
      .get(
35
        "/group/joined-groups?search="+searchParam,
35
        "/group/joined-groups?search=" + searchParam,
36
      )
36
      )
37
      .then((response) => {
37
      .then((response) => {
38
        const resData = response.data;
38
        const resData = response.data;
39
         (resData);
39
        (resData);
40
        if (resData.success) {
40
        if (resData.success) {
41
          setJoinedGroups(resData.data);
41
          setJoinedGroups(resData.data);
42
        }
42
        }
43
      });
43
      });
Línea 100... Línea 100...
100
            </div>
100
            </div>
101
          </div>
101
          </div>
102
        </div>
102
        </div>
103
        <div className="companies-list">
103
        <div className="companies-list">
104
          <div className="row" id="profiles-container">
104
          <div className="row" id="profiles-container">
-
 
105
            {
-
 
106
              joinedGroups.length
-
 
107
                ?
105
            {joinedGroups.map(
108
                joinedGroups.map(
106
              ({ image, name, privacy, link_view, link_leave }, index) => (
109
                  ({ image, name, privacy, link_view, link_leave }, index) => (
107
                <JoinedGroup
110
                    <JoinedGroup
108
                  image={image}
111
                      image={image}
109
                  name={name}
112
                      name={name}
110
                  privacy={privacy}
113
                      privacy={privacy}
111
                  link_view={link_view}
114
                      link_view={link_view}
112
                  link_leave={link_leave}
115
                      link_leave={link_leave}
113
                  key={index}
116
                      key={index}
114
                  onLeave={handleLeaveGroup}
117
                      onLeave={handleLeaveGroup}
115
                />
118
                    />
-
 
119
                  ))
116
              )
120
                :
-
 
121
                <div style={{ margin: "auto", textAlign: "center" }}>
-
 
122
                  Ningún registro coincidio con su consulta
-
 
123
                </div>
117
            )}
124
            }
118
          </div>
125
          </div>
119
          {/* <!--product-feed-tab end--> */}
126
          {/* <!--product-feed-tab end--> */}
120
        </div>
127
        </div>
121
      </div>
128
      </div>
-
 
129
      {
122
      {loading && (
130
        loading &&
123
        <div className="spinner-container">
131
        <div className="spinner-container">
124
          <Spinner />
132
          <Spinner />
125
        </div>
133
        </div>
126
      )}
134
      }
127
    </section>
135
    </section>
128
  );
136
  );
129
};
137
};
Línea 130... Línea 138...
130
 
138