Show loading indicator on page load
When there are 0 parties, show a loading indicator
This commit is contained in:
parent
a1f556583a
commit
0c50fea18b
1 changed files with 11 additions and 8 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue