Skip to content

Commit

Permalink
hotfix: board footer link
Browse files Browse the repository at this point in the history
  • Loading branch information
jijiseong committed Jul 13, 2024
1 parent c1032ef commit ac6f07a
Showing 1 changed file with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
} from '@app/_shadcn/components/ui/pagination';
import { BoardListParams } from '@app/_types/boardTypes';
import useArticleListQuery from '@app/_hooks/apis/boards/useArticleListQuery';
import { NEW_PATH } from '@app/_constants/urls';

function PageNav() {
const INTERVAL = 7;
Expand All @@ -28,7 +29,7 @@ function PageNav() {
const { maxPageNum: maxPage } = data;
const curPage = Number(curPageParam);

const prevPage = curPage - 1 < 1 ? 1 : curPage - 1;
const prevPage = curPage - 1 <= 1 ? 1 : curPage - 1;
const nextPage = curPage + 1 >= maxPage ? maxPage : curPage + 1;

const getCurPageList = () => {
Expand All @@ -49,7 +50,11 @@ function PageNav() {
<PaginationItem>
<PaginationPrevious
scroll={false}
href={`/boards/${boardType}/list/${prevPage}`}
href={NEW_PATH.boardList.url({
boardType,
page: prevPage,
category,
})}
/>
</PaginationItem>

Expand All @@ -58,7 +63,7 @@ function PageNav() {
<PaginationLink
scroll={false}
isActive={page === curPage}
href={`/boards/${boardType}/list/${page}`}
href={NEW_PATH.boardList.url({ boardType, page, category })}
>
{page}
</PaginationLink>
Expand All @@ -68,7 +73,11 @@ function PageNav() {
<PaginationItem>
<PaginationNext
scroll={false}
href={`/boards/${boardType}/list/${nextPage}`}
href={NEW_PATH.boardList.url({
boardType,
page: nextPage,
category,
})}
/>
</PaginationItem>
</PaginationContent>
Expand Down

0 comments on commit ac6f07a

Please sign in to comment.