From 895b892cf23575f82f5014a99a5c810abcb37795 Mon Sep 17 00:00:00 2001 From: Gabriel Kaszewski Date: Fri, 15 May 2026 04:21:11 +0200 Subject: [PATCH] feat(frontend): proper pagination with page numbers and ellipsis --- thoughts-frontend/app/page.tsx | 31 ++------ thoughts-frontend/app/users/all/page.tsx | 34 ++------- .../components/pagination-nav.tsx | 76 +++++++++++++++++++ 3 files changed, 89 insertions(+), 52 deletions(-) create mode 100644 thoughts-frontend/components/pagination-nav.tsx diff --git a/thoughts-frontend/app/page.tsx b/thoughts-frontend/app/page.tsx index b12d613..f319c87 100644 --- a/thoughts-frontend/app/page.tsx +++ b/thoughts-frontend/app/page.tsx @@ -18,13 +18,7 @@ import { buildThoughtThreads } from "@/lib/utils"; import { TopFriends } from "@/components/top-friends"; import { UsersCount } from "@/components/users-count"; -import { - Pagination, - PaginationContent, - PaginationItem, - PaginationNext, - PaginationPrevious, -} from "@/components/ui/pagination"; +import { PaginationNav } from "@/components/pagination-nav"; import { redirect } from "next/navigation"; export const metadata: Metadata = { @@ -127,24 +121,11 @@ async function FeedPage({

)} - {totalPages > 1 && ( - - - - 1 ? `/?page=${page - 1}` : "#"} - aria-disabled={page <= 1} - /> - - - = totalPages} - /> - - - - )} + `/?page=${p}`} + />