Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 1537 Rev 2343
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 ProfileCard from "../../../components/Profile";
9
import ProfileCard from "../../../components/Profile";
10
import SearchList from "../../../components/SearchList";
10
import SearchList from "../../../components/SearchList";
Línea 32... Línea 32...
32
    return () => {
32
    return () => {
33
      clearTimeout(axiosThrottle);
33
      clearTimeout(axiosThrottle);
34
    };
34
    };
35
  }, []);
35
  }, []);
Línea 36... Línea 36...
36
 
36
 
37
  const fetchAppliedJobs = async (searchParam='') => {
37
  const fetchAppliedJobs = async (searchParam = '') => {
38
    setLoading(true);
38
    setLoading(true);
39
    await axios
39
    await axios
40
      .get(
40
      .get(
41
        "/job/applied-jobs?search="+searchParam)
41
        "/job/applied-jobs?search=" + searchParam)
42
      .then((response) => {
42
      .then((response) => {
43
        const resData = response.data;
43
        const resData = response.data;
44
        if (resData.success) {
44
        if (resData.success) {
45
          setAppliedJobs(resData.data);
45
          setAppliedJobs(resData.data);
46
        }
46
        }
47
      });
47
      });
48
    setLoading(false);
48
    setLoading(false);
Línea 49... Línea 49...
49
  };
49
  };
Línea 50... Línea 50...
50
 
50
 
51
  
51
 
52
 
52
 
53
  return (
53
  return (
54
    <section className="companies-info" style={{ position: "relative" }}>
54
    <section className="companies-info" style={{ position: "relative" }}>
55
      <div className="container">
55
      <div className="container">
56
        <SearchList
56
        <SearchList
57
          title="Que he aplicado"
57
          title="Que he aplicado"
58
          fetchCallback={fetchAppliedJobs}
58
          fetchCallback={fetchAppliedJobs}
-
 
59
        />
59
        />
60
        <div
60
        <div
61
          className="companies-list"
61
          className="companies-list"
62
          id="profiles-container"
62
          style={{
63
          style={{
63
            padding: "0 15px",
-
 
64
          }}
64
            padding: "0 15px",
65
        >
65
          }}
66
          <div className="row" id="profiles-container">
66
        >
67
            {appliedJobs.length > 0 ? (
67
          {appliedJobs.length > 0 ? (
68
              appliedJobs.map(
68
            appliedJobs.map(
69
                (
69
              (
70
                  {
70
                {
71
                    title,
71
                  title,
72
                    employment_type,
72
                  employment_type,
73
                    last_date_of_application,
73
                  last_date_of_application,
74
                    link_view,
74
                  link_view,
75
                    link_remove,
75
                  link_remove,
76
                  },
76
                },
77
                  index
77
                index
78
                ) => (
78
              ) => (
79
                  <ProfileCard
79
                <ProfileCard
80
                    key={index}
80
                  key={index}
81
                    // image={image}
81
                  // image={image}
82
                    name={title}
82
                  name={title}
83
                    status={employment_type}
83
                  status={employment_type}
84
                    link_view={link_view}
84
                  link_view={link_view}
85
                    link_delete={link_remove}
-
 
86
                    fetchCallback={fetchAppliedJobs}
85
                  link_delete={link_remove}
-
 
86
                  fetchCallback={fetchAppliedJobs}
87
                  />
87
                />
88
                )
88
              )
89
              )
89
            )
90
            ) : (
-
 
91
              <p>No hay resultados</p>
90
          ) : (
92
            )}
91
            <p>No hay resultados</p>
93
          </div>
92
          )}
94
          {/* <!--product-feed-tab end--> */}
93
          {/* <!--product-feed-tab end--> */}
95
        </div>
94
        </div>