Skip to content

Commit

Permalink
fix: 공지사항 선택 오류
Browse files Browse the repository at this point in the history
  • Loading branch information
cweedlee committed Sep 9, 2024
1 parent 960683d commit b12f478
Showing 1 changed file with 20 additions and 9 deletions.
29 changes: 20 additions & 9 deletions components/agenda/agendaDetail/tabs/AgendaAnnouncements.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ export default function AgendaAnnouncements() {
size: 5,
isReady: Boolean(agendaKey),
});
const newHandler = (page: number) => {
setSelected(0);
return PagaNationElementProps.pageChangeHandler(page);
};

if (!agendaKey || !content) {
return (
Expand All @@ -41,16 +45,23 @@ export default function AgendaAnnouncements() {
setSelected={() => setSelected(idx)}
/>
))}
<PageNation {...PagaNationElementProps} />
<PageNation
{...PagaNationElementProps}
pageChangeHandler={newHandler}
/>
</div>
<AnnouncementItem
key={content[selected].id}
id={content[selected].id}
title={content[selected].title}
content={content[selected].content}
createdAt={content[selected].createdAt}
isSelected={true}
/>
{content[selected] ? (
<AnnouncementItem
key={content[selected].id}
id={content[selected].id}
title={content[selected].title}
content={content[selected].content}
createdAt={content[selected].createdAt}
isSelected={true}
/>
) : (
''
)}
</>
) : (
<div className={styles.emptyContainer}>공지사항이 없습니다.</div>
Expand Down

0 comments on commit b12f478

Please sign in to comment.