Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev 3416 Rev 3432
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 24... Línea -...
24
  const { feeds, timelineUrl, currentPage, loading, pages } = useSelector(
-
 
25
    ({ feed }) => feed
-
 
26
  );
-
 
27
 
-
 
28
  const {
24
  const { feeds, timelineUrl, currentPage, loading, pages } = useSelector(
Línea 29... Línea 25...
29
    data,
25
    ({ feed }) => feed
30
    loading: loadingCompany,
26
  )
Línea 31... Línea 27...
31
    refetch,
27
 
32
  } = useFetch(`/company/view/${uuid}`);
28
  const { data, isLoading, refetch } = useFetch(`/company/view/${uuid}`)
33
 
29
 
34
  const isFollower = !!data.link_unfollow;
30
  const isFollower = !!data.link_unfollow
Línea 35... Línea 31...
35
  const allFeeds = feeds.allIds.map((id) => feeds.byId[id]);
31
  const allFeeds = feeds.allIds.map((id) => feeds.byId[id])
36
 
32
 
37
  const onChangePageHandler = (currentPage) => {
33
  const onChangePageHandler = (currentPage) => {
Línea 38... Línea 34...
38
    dispatch(setCurrentPage(currentPage));
34
    dispatch(setCurrentPage(currentPage))
39
    window.scrollTo(0, 0);
35
    window.scrollTo(0, 0)
40
  };
36
  }
Línea 41... Línea 37...
41
 
37
 
42
  useEffect(() => {
38
  useEffect(() => {
43
    dispatch(fetchFeeds(timelineUrl, currentPage));
39
    dispatch(fetchFeeds(timelineUrl, currentPage))
Línea 44... Línea 40...
44
  }, [timelineUrl, currentPage]);
40
  }, [timelineUrl, currentPage])
45
 
41
 
46
  useEffect(() => {
42
  useEffect(() => {
Línea 76... Línea 72...
76
          <CompanyFollowers companyId={uuid} />
72
          <CompanyFollowers companyId={uuid} />
77
          <AboutCompany company={data} />
73
          <AboutCompany company={data} />
78
        </>
74
        </>
79
      )}
75
      )}
80
    />
76
    />
81
  );
77
  )
82
}
78
}