Skip to content

Commit

Permalink
chore: remove infinite scroll button
Browse files Browse the repository at this point in the history
  • Loading branch information
dominik-stumpf committed Nov 21, 2024
1 parent d41eff8 commit 30cfe33
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions src/app/explorer/_components/InfiniteScrollGuilds.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"use client";

import { GuildCard, GuildCardSkeleton } from "@/components/GuildCard";
import { Button } from "@/components/ui/Button";
import { useInfiniteQuery } from "@tanstack/react-query";
import { useIntersection } from "foxact/use-intersection";
import { useAtomValue } from "jotai";
Expand Down Expand Up @@ -62,21 +61,20 @@ export const InfiniteScrollGuilds = () => {
)}
aria-hidden
/>
{guilds.length === 0 &&
!isLoading &&
search &&
`No results for "${search}"`}
<Button
className="mt-8"
onClick={() => fetchNextPage()}
disabled={!hasNextPage || isFetchingNextPage}
>
{isFetchingNextPage
? "Loading more..."
: hasNextPage
? "Load More"
: "No More Data"}
</Button>

{guilds.length === 0 && !isLoading && search ? (
<p className="mt-6 text-center text-foreground-secondary">
`No results for "${search}"`
</p>
) : (
<p className="mt-6 text-center text-foreground-secondary">
{isFetchingNextPage
? "Loading more..."
: hasNextPage
? "Load More"
: "No More Data"}
</p>
)}
</section>
);
};

0 comments on commit 30cfe33

Please sign in to comment.