-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
130-0feature/PaginationButton 컴포넌트 구현 #134
base: main
Are you sure you want to change the base?
Conversation
interface PaginationButtonProps { | ||
number: number; | ||
currentPage: number; | ||
onClick: (number: number) => void; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
onClickPaginationButton 으로 바꾸어 주세요!
그리고 매개변수 네이밍이 number보단 page가 좋을 것 같습니다
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
넵!
|
||
export const PaginationButton = ({ number, currentPage, onClick }: PaginationButtonProps) => { | ||
const isActive = number === currentPage; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아래 함수 추가하시고, onClick 이벤트에 onClick={onClick(page)}
로 넣어주시면 될 거에요!
onClick = (page:number)=> () =>onClickPaginationButton(page)
const isActive = number === currentPage; | ||
|
||
const onClick = (page: number) => () => onClickPaginationButton(page); | ||
|
||
return ( | ||
<S.PaginationButton $isActive={isActive} onClick={() => onClick(number)}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
여기 onClick에 () => onClick(number) 대신 onClickPaginationButton(page)
넣어주시면 댑니다
📝 Summary
페이지네이션 버튼 컴포넌트를 구현했습니다.
🖼️ Screenshots
✅ PR Checklist
🔗 References
💬 Comments