Skip to content

Commit

Permalink
#83 fix: 팀 문서 없을시 문서 없다고 띄우기
Browse files Browse the repository at this point in the history
  • Loading branch information
sinamong0620 committed Sep 25, 2024
1 parent c62608b commit e6e2c83
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 13 deletions.
32 changes: 19 additions & 13 deletions src/pages/TeamDocumentBoard.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import Navbar from '../components/Navbar';
import Folder from '../components/Folder';
import Flex from '../components/Flex';
import * as S from '../styles/TeamDocumentStyled';
import { useLocation, useNavigate } from 'react-router-dom';
import folderimg from '../img/folderimg.png';
import { useEffect, useState } from 'react';
import addbutton from '../img/addbutton.png';
import leftarrow from '../img/leftarrow.png';
Expand Down Expand Up @@ -116,17 +114,25 @@ const TeamDocumentBoard = () => {
))}
</S.CategoriesContainer>

{/* 팀 문서 컴포넌트 */}
<S.DocumentContainer>
{teamDocuments.map((document, index) => (
<DocumentCard key={index} document={document} />
))}
</S.DocumentContainer>

{/* 페이지네이션 */}
<S.PaginationWrapper>
<Pagination count={pageInfo?.totalPages} page={page} onChange={handleChangePage} />
</S.PaginationWrapper>
{teamDocuments.length === 0 ? (
<Flex justifyContent="center" alignItems="center" height={300}>
<S.NotExistingDocument>생성된 팀 문서가 없어요</S.NotExistingDocument>
</Flex>
) : (
<>
{/* 팀 문서 컴포넌트 */}
<S.DocumentContainer>
{teamDocuments.map((document, index) => (
<DocumentCard key={index} document={document} />
))}
</S.DocumentContainer>

{/* 페이지네이션 */}
<S.PaginationWrapper>
<Pagination count={pageInfo?.totalPages} page={page} onChange={handleChangePage} />
</S.PaginationWrapper>
</>
)}
</S.MainDashBoardContainer>
<Outlet /> {/* 사이드 페이지를 위한 중첩 라우팅 */}
</S.MainDashBoardLayout>
Expand Down
6 changes: 6 additions & 0 deletions src/styles/TeamDocumentStyled.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -172,3 +172,9 @@ export const FileImgWrapper = styled.div`
export const FolderContainer = styled.div`
padding: 1.1875rem 2.125rem;
`;

export const NotExistingDocument = styled.div`
font-size: 1.2rem;
color: lightgray;
font-weight: 600;
`;

0 comments on commit e6e2c83

Please sign in to comment.