From dda55f1bae0ed5555df0f1c722ed5aaf8bd6eca2 Mon Sep 17 00:00:00 2001 From: "Yohan @ ScreenshotLabs" Date: Fri, 26 Apr 2024 12:03:25 +0200 Subject: [PATCH] feat: lower the max nfts bridgeable to 30 (#210) * feat: lower the max nfts bridgeable to 30 * name update --- apps/web/src/app/(routes)/bridge/[address]/TokenList.tsx | 8 +++++--- .../web/src/app/(routes)/bridge/_hooks/useNftSelection.ts | 2 +- 2 files changed, 6 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..8ef3c3a2 100644 --- a/apps/web/src/app/(routes)/bridge/[address]/TokenList.tsx +++ b/apps/web/src/app/(routes)/bridge/[address]/TokenList.tsx @@ -82,8 +82,10 @@ 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[0]?.ownedNfts.length ?? 0 > MAX_SELECTED_ITEMS; const isAllSelected = (totalSelectedNfts === MAX_SELECTED_ITEMS || @@ -137,7 +139,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();