Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 12149 Rev 14867
Línea 4... Línea 4...
4
import { useDispatch, useSelector } from 'react-redux'
4
import { useDispatch, useSelector } from 'react-redux'
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
 
Línea 9... Línea 9...
9
const FeedSection = React.memo(() => {
9
const FeedSection = () => {
Línea 10... Línea 10...
10
 
10
 
Línea 11... Línea 11...
11
	const { allFeeds, timelineUrl, pages, currentPage, loading } = useSelector(state => state.feed)
11
	const { allFeeds, timelineUrl, pages, currentPage, loading } = useSelector(state => state.feed)
12
 
12
 
13
	const dispatch = useDispatch()
13
	const dispatch = useDispatch()
Línea 14... Línea -...
14
 
-
 
15
	useEffect(() => {
14
 
16
		dispatch(fetchFeeds(timelineUrl, currentPage))
15
	useEffect(() => {
17
	}, [timelineUrl])
16
		dispatch(fetchFeeds(timelineUrl, currentPage))
18
 
17
	}, [timelineUrl])
19
 
18
 
Línea 20... Línea 19...
20
	const onChangePageHandler = (currentPage) => {
19
	const onChangePageHandler = (currentPage) => {
21
		dispatch(setCurrentPage(currentPage))
20
		dispatch(setCurrentPage(currentPage))
22
		dispatch(fetchFeeds(timelineUrl, currentPage))
21
		dispatch(fetchFeeds(timelineUrl, currentPage))
Línea 23... Línea -...
23
		window.scrollTo(0, 0)
-
 
24
	}
22
		window.scrollTo(0, 0)
25
 
23
	}
26
	if (loading) {
24
 
27
		return <Spinner />
25
	if (loading) {
28
	}
26
		return <Spinner />
Línea 45... Línea 43...
45
				currentActivePage={currentPage}
43
				currentActivePage={currentPage}
46
			/>
44
			/>
47
			<NotificationAlert />
45
			<NotificationAlert />
48
		</>
46
		</>
49
	)
47
	)
50
})
48
}
Línea 51... Línea -...
51
 
-
 
52
export default FeedSection
49
 
-
 
50
export default React.memo(FeedSection)
53
51