Show loading indicator on page load

When there are 0 parties, show a loading indicator
This commit is contained in:
Justin Edmund 2024-04-22 23:30:15 -07:00
parent a1f556583a
commit 0c50fea18b

View file

@ -144,14 +144,17 @@ const TeamsRoute: React.FC<Props> = ({
} }
const renderInfiniteScroll = ( const renderInfiniteScroll = (
<InfiniteScroll <>
dataLength={parties && parties.length > 0 ? parties.length : 0} {parties.length === 0 && renderLoading(3)}
next={() => setCurrentPage(currentPage + 1)} <InfiniteScroll
hasMore={totalPages > currentPage} dataLength={parties && parties.length > 0 ? parties.length : 0}
loader={renderLoading(3)} next={() => setCurrentPage(currentPage + 1)}
> hasMore={totalPages > currentPage}
<GridRepCollection>{renderParties()}</GridRepCollection> loader={renderLoading(3)}
</InfiniteScroll> >
<GridRepCollection>{renderParties()}</GridRepCollection>
</InfiniteScroll>
</>
) )
if (context) { if (context) {