Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 5414 Rev 5698
Línea 5... Línea 5...
5
import EmptySection from '../../../shared/empty-section/EmptySection'
5
import EmptySection from '../../../shared/empty-section/EmptySection'
6
import Spinner from '../../../shared/loading-spinner/Spinner'
6
import Spinner from '../../../shared/loading-spinner/Spinner'
7
import Feed from '../feed/FeedTemplate'
7
import Feed from '../feed/FeedTemplate'
Línea 8... Línea 8...
8
 
8
 
-
 
9
const ShareModal = React.lazy(() => import('../share-modal/ShareModal'))
9
const ShareModal = React.lazy(() => import('../share-modal/ShareModal'))
10
const PaginationComponent = React.lazy(() =>
-
 
11
  import('../../../shared/pagination/PaginationComponent')
Línea 10... Línea 12...
10
const PaginationComponent = React.lazy(() => import('../../../shared/pagination/PaginationComponent'))
12
)
11
 
13
 
Línea 12... Línea 14...
12
const isDashboard = window.location.pathname.includes('dashboard')
14
const isDashboard = window.location.pathname.includes('dashboard')
13
const isMobile = window.innerWidth < 768
15
const isMobile = window.innerWidth < 768
-
 
16
 
-
 
17
const FeedSection = ({ feed, image }) => {
14
 
18
  const { allFeeds, timelineUrl, pages, currentPage, loading } = useSelector(
15
const FeedSection = ({ feed, image }) => {
19
    (state) => state.feed
Línea -... Línea 20...
-
 
20
  )
16
  const { allFeeds, timelineUrl, pages, currentPage, loading } = useSelector((state) => state.feed)
21
  const dispatch = useDispatch()
Línea 17... Línea 22...
17
  const dispatch = useDispatch()
22
  const labels = useSelector((state) => state.labels)
18
  const labels = useSelector(state => state.labels)
23
 
19
 
24
  const fetchSpecificFeed = () =>
20
  const fetchSpecificFeed = () => dispatch(fetchFeeds(timelineUrl + '/feed/' + feed, 1))
25
    dispatch(fetchFeeds(timelineUrl + '/feed/' + feed, 1))
Línea 37... Línea 42...
37
    return <Spinner />
42
    return <Spinner />
38
  }
43
  }
Línea 39... Línea 44...
39
 
44
 
40
  return (
45
  return (
41
    <>
46
    <>
42
      {allFeeds.length
47
      {allFeeds.length ? (
43
        ? allFeeds.map((feed, index) => {
48
        allFeeds.map((feed, index) => {
-
 
49
          if (isMobile && isDashboard && index === 5) {
-
 
50
            const PeopleYouMayKnow = React.lazy(() =>
44
          if (isMobile && isDashboard && index === 5) {
51
              import(
-
 
52
                '../../../shared/helpers/people-you-may-know/PeopleYouMayKnow'
-
 
53
              )
45
            const PeopleYouMayKnow = React.lazy(() => import('../../../shared/helpers/people-you-may-know/PeopleYouMayKnow'))
54
            )
46
            return (
55
            return (
47
              <>
56
              <>
48
                <Suspense fallback={null}>
57
                <Suspense fallback={null}>
49
                  <PeopleYouMayKnow />
58
                  <PeopleYouMayKnow />
Línea 56... Línea 65...
56
                />
65
                />
57
              </>
66
              </>
58
            )
67
            )
59
          }
68
          }
60
          if (isMobile && isDashboard && index === 8) {
69
          if (isMobile && isDashboard && index === 8) {
-
 
70
            const HomeNews = React.lazy(() =>
61
            const HomeNews = React.lazy(() => import('../home-section/HomeNews'))
71
              import('../home-section/HomeNews')
-
 
72
            )
62
            return (
73
            return (
63
              <>
74
              <>
64
                <Suspense fallback={null}>
75
                <Suspense fallback={null}>
65
                  <HomeNews />
76
                  <HomeNews />
66
                </Suspense>
77
                </Suspense>
Línea 80... Línea 91...
80
              owner_shared={feed.owner_shared}
91
              owner_shared={feed.owner_shared}
81
              image={image}
92
              image={image}
82
            />
93
            />
83
          )
94
          )
84
        })
95
        })
-
 
96
      ) : (
85
        : <EmptySection message={labels.NOT_AVAILABLE_FEEDS} />
97
        <EmptySection message={labels.NOT_AVAILABLE_FEEDS} />
86
      }
98
      )}
87
      <Suspense fallback={null}>
99
      <Suspense fallback={null}>
88
        <ShareModal
-
 
89
          timelineUrl={timelineUrl}
-
 
90
          currentPage={currentPage}
100
        <ShareModal timelineUrl={timelineUrl} currentPage={currentPage} />
91
        />
-
 
92
      </Suspense>
101
      </Suspense>
93
      <Suspense fallback={null}>
102
      <Suspense fallback={null}>
94
        <PaginationComponent
103
        <PaginationComponent
95
          onChangePage={onChangePageHandler}
104
          onChangePage={onChangePageHandler}
96
          pages={pages}
105
          pages={pages}