Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 14867 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 14867 Rev 16650
Línea 5... Línea 5...
5
import PaginationComponent from '../../shared/PaginationComponent'
5
import PaginationComponent from '../../shared/PaginationComponent'
6
import Spinner from '../../shared/Spinner'
6
import Spinner from '../../shared/Spinner'
7
import NotificationAlert from '../../shared/notification/NotificationAlert'
7
import NotificationAlert from '../../shared/notification/NotificationAlert'
Línea 8... Línea 8...
8
 
8
 
9
const FeedSection = () => {
-
 
10
 
9
const FeedSection = () => {
-
 
10
  const { allFeeds, timelineUrl, pages, currentPage, loading } = useSelector(
-
 
11
    (state) => state.feed
11
	const { allFeeds, timelineUrl, pages, currentPage, loading } = useSelector(state => state.feed)
12
  )
12
 
13
 
13
	const dispatch = useDispatch()
14
  const dispatch = useDispatch()
14
 
15
 
15
	useEffect(() => {
16
  useEffect(() => {
16
		dispatch(fetchFeeds(timelineUrl, currentPage))
17
    dispatch(fetchFeeds(timelineUrl, currentPage))
17
	}, [timelineUrl])
18
  }, [timelineUrl])
18
 
19
 
19
	const onChangePageHandler = (currentPage) => {
20
  const onChangePageHandler = (currentPage) => {
20
		dispatch(setCurrentPage(currentPage))
21
    dispatch(setCurrentPage(currentPage))
21
		dispatch(fetchFeeds(timelineUrl, currentPage))
22
    dispatch(fetchFeeds(timelineUrl, currentPage))
22
		window.scrollTo(0, 0)
23
    window.scrollTo(0, 0)
23
	}
24
  }
24
 
25
 
25
	if (loading) {
26
  if (loading) {
26
		return <Spinner />
27
    return <Spinner />
27
	}
28
  }
28
 
29
 
29
	return (
30
  return (
30
		<>
-
 
31
			{
31
    <>
32
				allFeeds.map((feed) =>
-
 
33
					<FeedTemplate
-
 
34
						feed={feed}
32
      {allFeeds.map((feed) => (
35
						key={feed.feed_unique}
-
 
36
					/>
33
        <FeedTemplate feed={feed} key={feed.feed_unique} />
37
				)
-
 
38
			}
34
      ))}
39
			<PaginationComponent
35
      <PaginationComponent
40
				onChangePage={onChangePageHandler}
36
        onChangePage={onChangePageHandler}
41
				pages={pages}
37
        pages={pages}
42
				isRow
38
        isRow
43
				currentActivePage={currentPage}
39
        currentActivePage={currentPage}
44
			/>
40
      />
45
			<NotificationAlert />
41
      <NotificationAlert />
46
		</>
42
    </>
47
	)
43
  )
Línea 48... Línea -...
48
}
-
 
49
 
44
}
-
 
45