From a3532f87d7905b212013e19b37ffe4d463aebbb1 Mon Sep 17 00:00:00 2001 From: Ian Elliott Date: Tue, 10 Sep 2024 22:51:37 -0700 Subject: [PATCH] fixed bounties per page bug in my refactor --- src/app/[netname]/page.tsx | 4 ++-- src/components/layout/ContentHome.tsx | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/app/[netname]/page.tsx b/src/app/[netname]/page.tsx index 3242420a..03596090 100644 --- a/src/app/[netname]/page.tsx +++ b/src/app/[netname]/page.tsx @@ -1,9 +1,9 @@ 'use client'; -import * as React from 'react'; +import React from 'react'; +import { ToastContainer } from 'react-toastify'; import 'react-toastify/dist/ReactToastify.css'; -import { ToastContainer } from 'react-toastify'; import ContentHome from '@/components/layout/ContentHome'; import CreateBounty from '@/components/ui/CreateBounty'; diff --git a/src/components/layout/ContentHome.tsx b/src/components/layout/ContentHome.tsx index 3a7413a1..480816cd 100644 --- a/src/components/layout/ContentHome.tsx +++ b/src/components/layout/ContentHome.tsx @@ -1,10 +1,10 @@ 'use-client'; -import { useDynamicContext } from '@dynamic-labs/sdk-react-core'; import { usePathname } from 'next/navigation'; import { useEffect, useState } from 'react'; -import { useGetChain } from '@/hooks'; + import { cn } from '@/lib'; +import { useGetChain } from '@/hooks'; import { BountyList } from '@/components/ui'; import { fetchBounties, getContractRead } from '@/app/context'; import { BlacklistedBounties, PAGE_SIZE } from '@/constant/'; @@ -104,7 +104,7 @@ const ContentHome = () => { const contractRead = await getContractRead(); const bountyCounter = await contractRead.bountyCounter(); const totalBounties = Number(bountyCounter.toString()); - const data = await fetchBounties(-PAGE_SIZE, PAGE_SIZE); + const data = await fetchBounties(totalBounties - PAGE_SIZE, PAGE_SIZE); setBountiesData( data.sort((a, b) => Number(b.createdAt) - Number(a.createdAt))