From 4c2ece2752d9174cc629068e4c341baf85a3a16b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9B=90=EB=8D=94?= Date: Mon, 25 Jan 2021 22:25:53 +0900 Subject: [PATCH] fix: paginator --- components/Paginator.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/Paginator.tsx b/components/Paginator.tsx index fe09f79..f8c2b3f 100644 --- a/components/Paginator.tsx +++ b/components/Paginator.tsx @@ -1,6 +1,6 @@ import Link from 'next/link' const Paginator = ({ currentPage, totalPage }:PaginatorProps):JSX.Element => { - const pages = [1, currentPage === 1 ? 2 : currentPage - 1, currentPage === 1 ? 3 : currentPage, currentPage + 1, totalPage ] + const pages = [1, currentPage === 1 ? 2 : currentPage - 1, currentPage === 1 ? 3 : totalPage === currentPage ? currentPage - 2 : currentPage, currentPage + 1, totalPage ] return