Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v3.1.2 #1344

Merged
merged 9 commits into from
Dec 10, 2024
Merged

v3.1.2 #1344

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [[v3.1.2](https://github.com/multiversx/mx-sdk-dapp/pull/1344)] - 2024-12-09

- [Add pagination item count support to "AddressTable"](https://github.com/multiversx/mx-sdk-dapp/pull/1343)

## [[v3.1.1](https://github.com/multiversx/mx-sdk-dapp/pull/1342)] - 2024-12-09

- [Fix dApp compatibility check (webview provider)](https://github.com/multiversx/mx-sdk-dapp/pull/1341)

## [[v3.1.0](https://github.com/multiversx/mx-sdk-dapp/pull/1339)] - 2024-12-05
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@multiversx/sdk-dapp",
"version": "3.1.1",
"version": "3.1.2",
"description": "A library to hold the main logic for a dapp on the MultiversX blockchain",
"author": "MultiversX",
"license": "GPL-3.0-or-later",
Expand Down
2 changes: 1 addition & 1 deletion src/UI/Pagination/Pagination.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ const PaginationComponent = ({
}
}, [currentPage, currentPageIndex]);

if (totalPages === 1) {
if (totalPages <= 1) {
return null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { LedgerColumnsEnum } from '../enums';
import { LedgerLoading } from '../LedgerLoading';

const ADDRESSES_PER_PAGE = 10;
const TOTAL_ADDRESSES_PAGES = 500;
const TOTAL_ADDRESSES_COUNT = 5000;

export interface AddressTablePropsType extends WithClassnameType {
accounts: string[];
Expand All @@ -27,6 +27,7 @@ export interface AddressTablePropsType extends WithClassnameType {
ledgerModalTableSelectedItemClassName?: string;
ledgerModalTableNavigationButtonDisabledClassName?: string;
};
addressesCount?: number;
customContentComponent?: ReactNode;
dataTestId?: string;
loading: boolean;
Expand All @@ -42,6 +43,7 @@ export interface AddressTablePropsType extends WithClassnameType {
const AddressTableComponent = ({
accounts,
addressTableClassNames,
addressesCount = TOTAL_ADDRESSES_COUNT,
className = 'dapp-ledger-address-table',
customContentComponent,
dataTestId = DataTestIdsEnum.addressTableContainer,
Expand Down Expand Up @@ -140,6 +142,7 @@ const AddressTableComponent = ({
onGoToSpecificPage(newPage - 1);
};

const totalPages = Math.ceil(addressesCount / ADDRESSES_PER_PAGE);
const columns = [
LedgerColumnsEnum.Address,
LedgerColumnsEnum.Balance,
Expand Down Expand Up @@ -213,7 +216,7 @@ const AddressTableComponent = ({
<Pagination
className={styles?.ledgerAddressTablePagination}
currentPage={startIndex + 1}
totalPages={TOTAL_ADDRESSES_PAGES}
totalPages={totalPages}
onPageChange={handlePageChange}
disabledClassName={ledgerModalTableNavigationButtonDisabledClassName}
buttonsClassNames={ledgerModalTableNavigationButtonClassName}
Expand Down
Loading