Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 4021 Rev 4022
Línea 1... Línea 1...
1
/* eslint-disable react/prop-types */
1
/* eslint-disable react/prop-types */
2
import React, { useEffect } from "react";
2
import React, { Suspense, useEffect } from "react";
3
import { useDispatch, useSelector } from "react-redux";
3
import { useDispatch, useSelector } from "react-redux";
4
import { fetchFeeds, setCurrentPage } from "../../../redux/feed/feed.actions";
4
import { fetchFeeds, setCurrentPage } from "../../../redux/feed/feed.actions";
5
import Feed from "../feed/FeedTemplate";
5
import Feed from "../feed/FeedTemplate";
6
 
-
 
7
const ShareModal = React.lazy(() => import("../share-modal/ShareModal"))
6
const ShareModal = React.lazy(() => import("../share-modal/ShareModal"))
8
const PaginationComponent = React.lazy(() => import("../../../shared/pagination/PaginationComponent"))
7
const PaginationComponent = React.lazy(() => import("../../../shared/pagination/PaginationComponent"))
Línea 9... Línea 8...
9
 
8
 
10
const PATH = window.location.pathname
-
 
11
 
9
const isDashboard = window.location.pathname.includes('dashboard')
Línea 12... Línea 10...
12
// Props object {routeTimeline, feed, image}
10
const isMobile = window.innerWidth < 1000
Línea 13... Línea 11...
13
 
11
 
14
const FeedSection = ({ feed, image }) => {
12
const FeedSection = ({ feed, image }) => {
Línea 36... Línea 34...
36
 
34
 
37
  return (
35
  return (
38
    <>
36
    <>
39
      {allFeeds.length
37
      {allFeeds.length
40
        ? allFeeds.map((feed, index) => {
38
        ? allFeeds.map((feed, index) => {
41
          if (window.innerWidth < 1000 && index === 5 && PATH.includes('dashboard')) {
39
          if (isMobile && isDashboard && index === 5) {
42
            const PeopleYouMayKnow = React.lazy(() => import("../../../shared/helpers/people-you-may-know/PeopleYouMayKnow"))
40
            const PeopleYouMayKnow = React.lazy(() => import("../../../shared/helpers/people-you-may-know/PeopleYouMayKnow"))
43
            return (
41
            return (
44
              <>
42
              <>
45
                <PeopleYouMayKnow />
43
                <PeopleYouMayKnow />
Línea 50... Línea 48...
50
                  image={image}
48
                  image={image}
51
                />
49
                />
52
              </>
50
              </>
53
            )
51
            )
54
          }
52
          }
55
          if (window.innerWidth < 1000 && index === 8 && PATH.includes('dashboard')) {
53
          if (isMobile && isDashboard && index === 8) {
56
            const HomeNews = React.lazy(() => import("../home-section/HomeNews"))
54
            const HomeNews = React.lazy(() => import("../home-section/HomeNews"))
57
            return (
55
            return (
58
              <>
56
              <>
59
                <HomeNews />
57
                <HomeNews />
60
                <Feed
58
                <Feed
Línea 82... Línea 80...
82
      }
80
      }
83
      <ShareModal
81
      <ShareModal
84
        timelineUrl={timelineUrl}
82
        timelineUrl={timelineUrl}
85
        currentPage={currentPage}
83
        currentPage={currentPage}
86
      />
84
      />
-
 
85
      <Suspense fallback={null}>
87
      <PaginationComponent
86
        <PaginationComponent
88
        onChangePage={onChangePageHandler}
87
          onChangePage={onChangePageHandler}
89
        pages={pages}
88
          pages={pages}
90
        isRow
89
          isRow
91
        currentActivePage={currentPage}
90
          currentActivePage={currentPage}
92
      />
91
        />
-
 
92
      </Suspense>
93
    </>
93
    </>
94
  );
94
  );
95
};
95
};
Línea 96... Línea 96...
96
 
96
 
97
export default React.memo(FeedSection);
97
export default React.memo(FeedSection);