|
@ -52,23 +52,34 @@ const PostList = (props) => { |
|
|
}); |
|
|
}); |
|
|
}, [focusOnPost, getPostCallHashes, loading, pageNumber, postIds]); |
|
|
}, [focusOnPost, getPostCallHashes, loading, pageNumber, postIds]); |
|
|
|
|
|
|
|
|
|
|
|
const footer = useMemo(() => { |
|
|
const handlePageChange = (event, data) => { |
|
|
const handlePageChange = (event, data) => { |
|
|
setPageNumber(data.activePage); |
|
|
setPageNumber(data.activePage); |
|
|
onPageChange(event, data); |
|
|
onPageChange(event, data); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
if (numberOfItems <= ITEMS_PER_PAGE) { |
|
|
|
|
|
return null; |
|
|
|
|
|
} |
|
|
return ( |
|
|
return ( |
|
|
<> |
|
|
<> |
|
|
<Dimmer.Dimmable as={Feed} blurring dimmed={loading} id="post-list" size="large"> |
|
|
|
|
|
<Loader active={loading} /> |
|
|
|
|
|
{posts} |
|
|
|
|
|
</Dimmer.Dimmable> |
|
|
|
|
|
<Divider /> |
|
|
<Divider /> |
|
|
<div id="post-list-pagination"> |
|
|
<div id="post-list-pagination"> |
|
|
<PaginationComponent onPageChange={handlePageChange} numberOfItems={numberOfItems} /> |
|
|
<PaginationComponent onPageChange={handlePageChange} numberOfItems={numberOfItems} /> |
|
|
</div> |
|
|
</div> |
|
|
</> |
|
|
</> |
|
|
); |
|
|
); |
|
|
|
|
|
}, [numberOfItems, onPageChange]); |
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
|
|
<> |
|
|
|
|
|
<Dimmer.Dimmable as={Feed} blurring dimmed={loading} id="post-list" size="large"> |
|
|
|
|
|
<Loader active={loading} /> |
|
|
|
|
|
{posts} |
|
|
|
|
|
</Dimmer.Dimmable> |
|
|
|
|
|
{footer} |
|
|
|
|
|
</> |
|
|
|
|
|
); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
PostList.propTypes = { |
|
|
PostList.propTypes = { |
|
|