Skip to content

Commit 06288d0

Browse files
committed
fix: [GSW-2407] Pagination count
1 parent fc80394 commit 06288d0

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

packages/web/src/components/common/my-position-card-list/MyPositionCardList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ const MyPositionCardList: React.FC<MyPositionCardListProps> = ({
6868
const shouldShowPositionIndicator = showPositionIndicator && isFetched && hasPositions && !isLoading;
6969
const shouldShowPagination = Boolean(totalPage && totalPage > 1 && !loadMore);
7070
const targetCount = shouldShowPagination && limit ? limit : maxDisplayCount;
71-
const shouldShowBlankCards = isFetched && !isLoading && hasPositions && positions.length < targetCount;
71+
const shouldShowBlankCards = isFetched && !isLoading && hasPositions && positions.length < maxDisplayCount;
7272

7373
const blankCardCount = useMemo(() => {
7474
if (!shouldShowBlankCards) return 0;

packages/web/src/layouts/earn/containers/earn-my-position-container/EarnMyPositionContainer.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,8 +294,8 @@ const EarnMyPositionContainer: React.FC<EarnMyPositionContainerProps> = ({
294294
* Calculate total number of pages based on server total count
295295
*/
296296
const totalPage = useMemo(() => {
297-
return Math.ceil(totalPositionCount / 20);
298-
}, [totalPositionCount]);
297+
return Math.ceil(totalPositionCount / limit);
298+
}, [totalPositionCount, limit]);
299299

300300
const maxDisplayCount = useMemo(() => {
301301
const { DESKTOP_MIN, TABLET_MIN } = POSITION_CARD_BREAKPOINTS;

packages/web/src/layouts/portfolio/containers/wallet-position-card-list-container/WalletPositionCardListContainer.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,8 @@ const WalletPositionCardListContainer: React.FC<{ isClosed: boolean }> = ({ isCl
250250
* Calculate total number of pages based on server total count
251251
*/
252252
const totalPage = useMemo(() => {
253-
return Math.ceil(totalPositionCount / 20);
254-
}, [totalPositionCount]);
253+
return Math.ceil(totalPositionCount / limit);
254+
}, [totalPositionCount, limit]);
255255

256256
const maxDisplayCount = useMemo(() => {
257257
const { DESKTOP_MIN, TABLET_MIN } = POSITION_CARD_BREAKPOINTS;

0 commit comments

Comments
 (0)