Skip to content

Commit

Permalink
fix: 공지사항 분류 미선택시 emptyContainer 렌더링
Browse files Browse the repository at this point in the history
  • Loading branch information
maylh committed Aug 19, 2024
1 parent ed3d6b6 commit 2b6e667
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/app/(route)/admin/(with-layout)/notices/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ const NoticesListPage = () => {
},
});

const isNoticeTypeSelected = param.noticeType.length > 0;

return (
<section className="w-full">
<div className="mb-12 flex items-center justify-between">
Expand Down Expand Up @@ -119,6 +121,7 @@ const NoticesListPage = () => {
endDatePlaceholder="마감일 선택"
/>
</FilteringBarContainer>

<TableContainer minWidth="1000px">
<TableHeaderModule>
<TableHeaderAtom isFirst width="80px">
Expand All @@ -131,7 +134,9 @@ const NoticesListPage = () => {
</TableHeaderModule>

<tbody>
{!data ? (
{!isNoticeTypeSelected ? (
<EmptyContainer colSpan={5} />
) : !data ? (
isLoading ? (
<EmptyContainer colSpan={5} text="loading" />
) : (
Expand Down Expand Up @@ -162,8 +167,9 @@ const NoticesListPage = () => {
)}
</tbody>
</TableContainer>

<div className="relative mt-8">
{data && data.pageInfo.totalElements > 0 && (
{isNoticeTypeSelected && data && data.pageInfo.totalElements > 0 && (
<div className="flex justify-center">
<PaginationModule
currentPage={currentPage}
Expand Down

0 comments on commit 2b6e667

Please sign in to comment.