Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 5107 Rev 5901
Línea 4... Línea 4...
4
import { fetchFeeds, setCurrentPage } from '../../../../redux/feed/feed.actions'
4
import { fetchFeeds, setCurrentPage } from '../../../../redux/feed/feed.actions'
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 ShareModal from '../../../components/share-modal/ShareModal'
7
import ShareModal from '../../../components/share-modal/ShareModal'
8
import Feed from './Feed'
8
import Feed from './Feed'
-
 
9
const PaginationComponent = React.lazy(() =>
9
const PaginationComponent = React.lazy(() => import('../../../../shared/pagination/PaginationComponent'))
10
  import('../../../../shared/pagination/PaginationComponent')
-
 
11
)
10
 
12
 
11
const FeedList = ({
13
const FeedList = ({ feed = {}, image = '' }) => {
12
  feed = {},
14
  const { allFeeds, timelineUrl, pages, currentPage, loading } = useSelector(
13
  image = ''
15
    (state) => state.feed
14
}) => {
16
  )
15
  const { allFeeds, timelineUrl, pages, currentPage, loading } = useSelector((state) => state.feed)
-
 
16
  const dispatch = useDispatch()
17
  const dispatch = useDispatch()
Línea -... Línea 18...
-
 
18
 
17
 
19
  const fetchSpecificFeed = () =>
Línea 18... Línea 20...
18
  const fetchSpecificFeed = () => dispatch(fetchFeeds(timelineUrl + '/feed/' + feed, 1))
20
    dispatch(fetchFeeds(timelineUrl + '/feed/' + feed, 1))
19
 
21
 
20
  useEffect(() => {
22
  useEffect(() => {
21
    if (feed) {
23
    if (feed) {
Línea 34... Línea 36...
34
  if (loading) {
36
  if (loading) {
35
    return <Spinner />
37
    return <Spinner />
36
  }
38
  }
Línea 37... Línea 39...
37
 
39
 
38
  if (!allFeeds.length) {
40
  if (!allFeeds.length) {
39
    return <EmptySection message='No hay publicaciones' />
41
    return <EmptySection message="No hay publicaciones" />
Línea 40... Línea 42...
40
  }
42
  }
41
 
43
 
42
  return (
44
  return (
43
    <>
-
 
44
      {allFeeds.map((feed) => {
-
 
45
        return (
45
    <>
46
          <Feed
-
 
47
            key={feed.feed_unique}
-
 
48
            image={image}
-
 
49
            {...feed}
-
 
50
          />
46
      {allFeeds.map((feed) => {
51
        )
47
        return <Feed key={feed.feed_unique} image={image} {...feed} />
52
      })}
48
      })}
53
      <React.Suspense fallback={null}>
49
      <React.Suspense fallback={null}>
54
        <PaginationComponent
50
        <PaginationComponent
55
          onChangePage={onChangePageHandler}
51
          onChangePage={onChangePageHandler}
56
          pages={pages}
52
          pages={pages}
57
          isRow
53
          isRow
58
          currentActivePage={currentPage}
54
          currentActivePage={currentPage}
59
        />
-
 
60
      </React.Suspense>
-
 
61
      <ShareModal
55
        />
62
        timelineUrl={timelineUrl}
-
 
63
        currentPage={currentPage}
56
      </React.Suspense>
64
      />
57
      <ShareModal timelineUrl={timelineUrl} currentPage={currentPage} />
65
    </>
58
    </>
Línea 66... Línea 59...
66
  )
59
  )