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 = (
<InfiniteScroll
dataLength={parties && parties.length > 0 ? parties.length : 0}
next={() => setCurrentPage(currentPage + 1)}
hasMore={totalPages > currentPage}
loader={renderLoading(3)}
>
<GridRepCollection>{renderParties()}</GridRepCollection>
</InfiniteScroll>
<>
{parties.length === 0 && renderLoading(3)}
<InfiniteScroll
dataLength={parties && parties.length > 0 ? parties.length : 0}
next={() => setCurrentPage(currentPage + 1)}
hasMore={totalPages > currentPage}
loader={renderLoading(3)}
>
<GridRepCollection>{renderParties()}</GridRepCollection>
</InfiniteScroll>
</>
)
if (context) {