Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

Rev 1 | Rev 1590 | 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 { useForm } from "react-hook-form";
3
import { useForm } from "react-hook-form";
4
import styled from "styled-components";
4
import styled from "styled-components";
5
import {axios} from "../../../utils";
5
import { axios } from "../../../utils";
6
import Company from "./company/Company";
6
import Company from "./company/Company";
7
import Spinner from "../../../shared/loading-spinner/Spinner";
7
import Spinner from "../../../shared/loading-spinner/Spinner";
8
import { connect } from "react-redux";
8
import { connect } from "react-redux";
9
import { addNotification } from "../../../redux/notification/notification.actions";
9
import { addNotification } from "../../../redux/notification/notification.actions";
Línea 39... Línea 39...
39
    return () => {
39
    return () => {
40
      clearTimeout(axiosThrottle);
40
      clearTimeout(axiosThrottle);
41
    };
41
    };
42
  }, []);
42
  }, []);
Línea 43... Línea 43...
43
 
43
 
44
  const fetchCompanies = async (searchParam='') => {
44
  const fetchCompanies = async (searchParam = '') => {
45
    setLoading(true);
45
    setLoading(true);
46
    await axios
46
    await axios
47
      .get(
47
      .get(
48
        "/company/following-companies?search="+searchParam)
48
        "/company/following-companies?search=" + searchParam)
49
      .then((response) => {
49
      .then((response) => {
50
        const resData = response.data;
50
        const resData = response.data;
51
        if (resData.success) {
51
        if (resData.success) {
52
          setCompanies(resData.data);
52
          setCompanies(resData.data);
Línea 125... Línea 125...
125
              id="profiles-container"
125
              id="profiles-container"
126
              style={{
126
              style={{
127
                position: "relative",
127
                position: "relative",
128
              }}
128
              }}
129
            >
129
            >
-
 
130
              {
130
              {companies.length ? (
131
                companies.length
131
                companies.map(
132
                  ?
132
                  ({ image, name, link_view, link_unfollow }, index) => (
133
                  companies.map(({ image, name, link_view, link_unfollow }, index) => (
133
                    <Company
134
                    <Company
134
                      image={image}
135
                      image={image}
135
                      name={name}
136
                      name={name}
136
                      link_view={link_view}
137
                      link_view={link_view}
137
                      link_unfollow={link_unfollow}
138
                      link_unfollow={link_unfollow}
138
                      onUnfollow={handleUnfollow}
139
                      onUnfollow={handleUnfollow}
139
                      index={index}
140
                      index={index}
140
                      key={index}
141
                      key={index}
141
                    />
142
                    />
142
                  )
143
                  ))
143
                )
-
 
144
              ) : (
144
                  :
145
                <div style={{ margin: "auto", textAlign: "center" }}>
145
                  <div style={{ margin: "auto", textAlign: "center" }}>
146
                  Ningún registro coincidio con su consulta
146
                    Ningún registro coincidio con su consulta
147
                </div>
147
                  </div>
148
              )}
148
              }
-
 
149
              {
149
              {loading && (
150
                loading
-
 
151
                &&
150
                <StyledSpinnerContainer>
152
                <StyledSpinnerContainer>
151
                  <Spinner />
153
                  <Spinner />
152
                </StyledSpinnerContainer>
154
                </StyledSpinnerContainer>
153
              )}
155
              }
154
            </div>
156
            </div>
155
            {/* <!--product-feed-tab end--> */}
157
            {/* <!--product-feed-tab end--> */}
156
          </div>
158
          </div>
157
        </div>
159
        </div>
158
      </section>
160
      </section>