From d031db944b4db2bd9155e71dd4c9ff2f7e28e6e4 Mon Sep 17 00:00:00 2001 From: Yohan Tancrez Date: Fri, 26 Apr 2024 11:58:04 +0200 Subject: [PATCH] feat: lower the max nfts bridgeable to 30 --- apps/web/src/app/(routes)/bridge/[address]/TokenList.tsx | 9 ++++++--- .../src/app/(routes)/bridge/_hooks/useNftSelection.ts | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/apps/web/src/app/(routes)/bridge/[address]/TokenList.tsx b/apps/web/src/app/(routes)/bridge/[address]/TokenList.tsx index be0a2e53..09ba33be 100644 --- a/apps/web/src/app/(routes)/bridge/[address]/TokenList.tsx +++ b/apps/web/src/app/(routes)/bridge/[address]/TokenList.tsx @@ -82,8 +82,11 @@ export default function TokenList({ nftContractAddress }: TokenListProps) { return ; } - const hasMoreThan100Nfts = - nftsData.pages.length > 1 || (nftsData.pages.length === 1 && hasNextPage); + // const hasMoreThan100Nfts = + // nftsData.pages.length > 1 || (nftsData.pages.length === 1 && hasNextPage); + const hasMoreThanMaxSelectNfts = + (nftsData.pages.length > 0 && nftsData.pages[0]?.ownedNfts.length) ?? + 0 > MAX_SELECTED_ITEMS; const isAllSelected = (totalSelectedNfts === MAX_SELECTED_ITEMS || @@ -137,7 +140,7 @@ export default function TokenList({ nftContractAddress }: TokenListProps) { size="small" > - {hasMoreThan100Nfts ? "Select 100 Max" : "Select All"} + {hasMoreThanMaxSelectNfts ? "Select 30 Max" : "Select All"} )} diff --git a/apps/web/src/app/(routes)/bridge/_hooks/useNftSelection.ts b/apps/web/src/app/(routes)/bridge/_hooks/useNftSelection.ts index e879ddb5..77c367bf 100644 --- a/apps/web/src/app/(routes)/bridge/_hooks/useNftSelection.ts +++ b/apps/web/src/app/(routes)/bridge/_hooks/useNftSelection.ts @@ -5,7 +5,7 @@ import useAccountFromChain from "~/app/_hooks/useAccountFromChain"; import useCurrentChain from "~/app/_hooks/useCurrentChain"; import { type Nft } from "~/server/api/types"; -export const MAX_SELECTED_ITEMS = 100; +export const MAX_SELECTED_ITEMS = 30; export default function useNftSelection() { const { sourceChain } = useCurrentChain();