Skip to content

Commit

Permalink
fix pagination bug
Browse files Browse the repository at this point in the history
  • Loading branch information
samepant committed Jan 20, 2024
1 parent c1fff44 commit c7a921f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion frontend/src/components/Layout/Layout.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
display: flex;
flex-direction: column;
align-items: center;
margin: 100px 0;
margin: 150px 0 50px;
position: relative;
z-index: 10;
padding: 0 20px;
Expand Down
5 changes: 4 additions & 1 deletion frontend/src/components/NFTGrid/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@ export const CollectionNftGrid: React.FC<Props> = ({ address }) => {
const nftBalances =
(currentPage?.result as MoralisNFT[]) || ([] as MoralisNFT[])

const previousPageAvailable = (data?.pageParams[0] as string[]).length > 0
const previousPageAvailable =
data &&
data.pageParams.length > 0 &&
(data.pageParams[0] as string[]).length > 0
const nextPageAvailable = currentPage?.cursor && currentPage.cursor.length > 0

const deployedMechs = useDeployedMechs(getNFTContexts(nftBalances), chainId)
Expand Down

1 comment on commit c7a921f

@vercel
Copy link

@vercel vercel bot commented on c7a921f Jan 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.