Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev 3108 Rev 3416
Línea 1... Línea 1...
1
import React, { useEffect } from 'react'
1
import React, { useEffect } from "react";
2
import { useDispatch, useSelector } from 'react-redux'
2
import { useDispatch, useSelector } from "react-redux";
3
import { useParams } from 'react-router-dom'
3
import { useParams } from "react-router-dom";
Línea 4... Línea 4...
4
 
4
 
5
import { useFetch } from '@hooks'
5
import { useFetch } from "@hooks";
6
import {
6
import {
7
  fetchFeeds,
7
  fetchFeeds,
8
  setCurrentPage,
8
  setCurrentPage,
9
  setTimelineUrl
9
  setTimelineUrl,
Línea 10... Línea 10...
10
} from '@store/feed/feed.actions'
10
} from "@store/feed/feed.actions";
11
 
11
 
12
import AppGrid from '@components/UI/layout/AppGrid'
12
import AppGrid from "@components/UI/layout/AppGrid";
13
import Spinner from '@components/UI/Spinner'
13
import Spinner from "@components/UI/Spinner";
14
import Pagination from '@components/common/Pagination'
14
import Pagination from "@components/common/Pagination";
15
import FeedList from '@components/dashboard/linkedin/feed-list/FeedList'
15
import FeedList from "@components/dashboard/linkedin/feed-list/FeedList";
16
import CompanyFollowers from '@components/company/company-followers'
16
import CompanyFollowers from "@components/company/company-followers";
17
import CompanyWidget from '@components/company/company-widget'
17
import CompanyWidget from "@components/company/company-widget";
Línea 18... Línea 18...
18
import AboutCompany from '@components/company/about-company'
18
import AboutCompany from "@components/company/about-company";
19
import CompanyInfo from '@components/company/company-info'
19
import CompanyInfo from "@components/company/company-info";
20
 
20
 
21
export default function LinkedInCompany() {
21
export default function LinkedInCompany() {
22
  const { uuid } = useParams()
22
  const { uuid } = useParams();
23
  const dispatch = useDispatch()
23
  const dispatch = useDispatch();
Línea -... Línea 24...
-
 
24
  const { feeds, timelineUrl, currentPage, loading, pages } = useSelector(
-
 
25
    ({ feed }) => feed
-
 
26
  );
-
 
27
 
24
  const { feeds, timelineUrl, currentPage, loading, pages } = useSelector(
28
  const {
Línea 25... Línea 29...
25
    ({ feed }) => feed
29
    data,
26
  )
30
    loading: loadingCompany,
Línea 27... Línea 31...
27
 
31
    refetch,
28
  const { data, isLoading, refetch } = useFetch(`/company/view/${uuid}`)
32
  } = useFetch(`/company/view/${uuid}`);
29
 
33
 
30
  const isFollower = !!data.link_unfollow
34
  const isFollower = !!data.link_unfollow;
Línea 31... Línea 35...
31
  const allFeeds = feeds.allIds.map((id) => feeds.byId[id])
35
  const allFeeds = feeds.allIds.map((id) => feeds.byId[id]);
32
 
36
 
33
  const onChangePageHandler = (currentPage) => {
37
  const onChangePageHandler = (currentPage) => {
Línea 34... Línea 38...
34
    dispatch(setCurrentPage(currentPage))
38
    dispatch(setCurrentPage(currentPage));
35
    window.scrollTo(0, 0)
39
    window.scrollTo(0, 0);
36
  }
40
  };
Línea 37... Línea 41...
37
 
41
 
38
  useEffect(() => {
42
  useEffect(() => {
39
    dispatch(fetchFeeds(timelineUrl, currentPage))
43
    dispatch(fetchFeeds(timelineUrl, currentPage));
Línea 40... Línea 44...
40
  }, [timelineUrl, currentPage])
44
  }, [timelineUrl, currentPage]);
41
 
45
 
42
  useEffect(() => {
46
  useEffect(() => {
Línea 72... Línea 76...
72
          <CompanyFollowers companyId={uuid} />
76
          <CompanyFollowers companyId={uuid} />
73
          <AboutCompany company={data} />
77
          <AboutCompany company={data} />
74
        </>
78
        </>
75
      )}
79
      )}
76
    />
80
    />
77
  )
81
  );
78
}
82
}