Skip to content

Commit

Permalink
♻️ refactor: 현재 페이지에 따른 버튼 색 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
Kbomi16 committed Jun 8, 2024
1 parent 033a1e5 commit d89c363
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions components/Pagination.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,14 @@ export default function Pagination({
</button>
{pages.length > 0 &&
pages.map((i) => (
<div key={i}>
<div onClick={() => onPageChange(i)}>{i}</div>
<div
key={i}
className={`flex h-10 w-10 cursor-pointer items-center justify-center rounded-full border border-gray-300 font-bold ${
currentPage === i ? "bg-[--btn1] text-white" : ""
} hover:bg-[--btn1] hover:text-white`}
onClick={() => onPageChange(i)}
>
{i}
</div>
))}
<button
Expand Down

0 comments on commit d89c363

Please sign in to comment.