File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
src/projects/list/components/Projects Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -41,14 +41,15 @@ const ProjectsCardView = props => {
4141 const handleLoadMore = ( ) => {
4242 onPageChange ( pageNum + 1 )
4343 }
44+ const hasMore = ( ( pageNum - 1 ) * 20 + 20 < totalCount )
4445 return (
4546 < div className = "projects card-view" >
4647 { ! ! inifinite &&
4748 < InfiniteScroll
4849 initialLoad = { false }
4950 pageStart = { pageNum }
5051 loadMore = { onPageChange }
51- hasMore = { ( ( pageNum - 1 ) * 20 + 20 < totalCount ) }
52+ hasMore = { hasMore }
5253 loader = { < LoadingIndicator /> }
5354 >
5455 { projects . map ( renderProject ) }
@@ -61,7 +62,8 @@ const ProjectsCardView = props => {
6162 < div className = "project-card" > < NewProjectCard /> </ div >
6263 </ div >
6364 }
64- { ! inifinite && < button type = "button" className = "tc-btn tc-btn-primary" onClick = { handleLoadMore } > Load more</ button > }
65+ { ! inifinite && hasMore && < button type = "button" className = "tc-btn tc-btn-primary" onClick = { handleLoadMore } > Load more</ button > }
66+ { ! hasMore && < span > End of results</ span > }
6567 </ div >
6668 )
6769}
You can’t perform that action at this time.
0 commit comments