diff --git a/packages/suite/src/components/wallet/Pagination.tsx b/packages/suite/src/components/wallet/Pagination.tsx index 8251f75be71..bd5e25a6eca 100644 --- a/packages/suite/src/components/wallet/Pagination.tsx +++ b/packages/suite/src/components/wallet/Pagination.tsx @@ -53,6 +53,7 @@ interface PaginationProps { hasPages?: boolean; perPage: number; totalItems: number; + limitedPageList?: boolean; onPageSelected: (page: number) => void; } @@ -63,6 +64,7 @@ export const Pagination = ({ isLastPage, perPage, totalItems, + limitedPageList, ...rest }: PaginationProps) => { const totalPages = Math.ceil(totalItems / perPage); @@ -98,17 +100,19 @@ export const Pagination = ({ {totalPages ? ( - calculatedPages.map(i => ( - onPageSelected(i)} - $isActive={i === currentPage} - > - {i} - - )) + calculatedPages + .slice(0, limitedPageList ? currentPage + 2 : calculatedPages.length) + .map(i => ( + onPageSelected(i)} + $isActive={i === currentPage} + > + {i} + + )) ) : ( <> {[...Array(currentPage - 1)].map((_p, i) => ( @@ -131,7 +135,7 @@ export const Pagination = ({ onPageSelected(currentPage + 1)}>› - {totalPages && totalPages > 2 && ( + {totalPages && totalPages > 2 && !limitedPageList && ( onPageSelected(totalPages)}>» )} diff --git a/packages/suite/src/views/wallet/transactions/TransactionList/TransactionList.tsx b/packages/suite/src/views/wallet/transactions/TransactionList/TransactionList.tsx index 32c178d9f9c..bc4b9bd768d 100644 --- a/packages/suite/src/views/wallet/transactions/TransactionList/TransactionList.tsx +++ b/packages/suite/src/views/wallet/transactions/TransactionList/TransactionList.tsx @@ -33,6 +33,7 @@ interface TransactionListProps { symbol: WalletAccountTransaction['symbol']; isLoading?: boolean; account: Account; + limitPaging?: boolean; customTotalItems?: number; isExportable?: boolean; customPageFetching?: boolean; @@ -45,6 +46,7 @@ export const TransactionList = ({ isLoading, account, symbol, + limitPaging, customTotalItems, onPageRequested, isExportable = true, @@ -194,6 +196,7 @@ export const TransactionList = ({ {showPagination && ( { return network.displaySymbolName || network.name; }; + +export const areNetworkTransactionsUnreliable = (symbol: NetworkSymbol) => + UNRELIABLE_TRANSACTION_COINS.some(coin => coin === symbol);