diff --git a/src/app/team/[teamId]/study/[studyId]/page.tsx b/src/app/team/[teamId]/study/[studyId]/page.tsx index 163b116..f2816ed 100644 --- a/src/app/team/[teamId]/study/[studyId]/page.tsx +++ b/src/app/team/[teamId]/study/[studyId]/page.tsx @@ -5,6 +5,7 @@ import { useAtomValue } from 'jotai'; import NextLink from 'next/link'; import { useRouter } from 'next/navigation'; import { useEffect, useState } from 'react'; +import { BsPlus } from 'react-icons/bs'; import { MdOutlineArrowForwardIos } from 'react-icons/md'; import { getDocumentList } from '@/app/api/document'; @@ -12,6 +13,8 @@ import { getStudy, getStudyMembers } from '@/app/api/study'; import { myTeamAtom } from '@/atom'; import DocumentCard from '@/components/DocumentCard'; import Title from '@/components/Title'; +import CreateDocumentModal from '@/containers/study/CreateDocumentModal'; +import { CreateDocument } from '@/containers/study/CreateDocumentModal/type'; import CurriculumCard from '@/containers/study/CurriculumCard'; import DeleteStudyModal from '@/containers/study/Modal/DeleteStudyModal'; import StudyModal from '@/containers/study/Modal/StudyModal'; @@ -30,6 +33,8 @@ const Page = ({ params }: { params: { teamId: number; studyId: number } }) => { const [isDeleteModalOpen, setIsDeleteModalOpen] = useState(false); const [isTerminateModalOpen, setIsTerminateModalOpen] = useState(false); const [documentArray, setDocumentArray] = useState([]); + const [isCreateDocumentModalOpen, setIsCreateDocumentModalOpen] = useState(false); + const categoryData: CreateDocument = { groupId: params.studyId, groupType: 'studies' }; const router = useRouter(); const user = useGetUser(); @@ -58,7 +63,7 @@ const Page = ({ params }: { params: { teamId: number; studyId: number } }) => { setDocumentArray(res.body.content); } }); - }, [params.studyId, isEditModalOpen]); + }, [params.studyId, isEditModalOpen, isCreateDocumentModalOpen]); useEffect(() => { if (!isTerminateModalOpen) { @@ -108,25 +113,34 @@ const Page = ({ params }: { params: { teamId: number; studyId: number } }) => { /> )} - - + + + + } + isRound + size="icon_sm" + variant="icon_orange" + /> + 전체 보기 + } - isRound - size="icon_sm" - variant="icon_orange" + icon={} + onClick={() => setIsCreateDocumentModalOpen(true)} + size="icon_md" + variant="icon_orange_dark" /> - 전체 보기 - + {documentArray && documentArray.length > 0 ? ( {documentArray.map((data) => ( @@ -162,7 +176,7 @@ const Page = ({ params }: { params: { teamId: number; studyId: number } }) => { refetchMembers={handleRefetchMembers} /> )} - + {participantData && } @@ -186,6 +200,13 @@ const Page = ({ params }: { params: { teamId: number; studyId: number } }) => { isOpen={isDeleteModalOpen} setIsOpen={setIsDeleteModalOpen} /> + + setIsCreateDocumentModalOpen(false)} + categoryData={categoryData} + category="create" + /> ); };