-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
204 additions
and
137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
apps/admin/app/studies/[studyId]/_components/curriculum/CurriculumList.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { Space, Text } from "@wow-class/ui"; | ||
import { studyApi } from "apis/study/studyApi"; | ||
|
||
import CurriculumListItem from "./CurriculumListItem"; | ||
import EmptyCurriculumList from "./EmptyCurriculumList"; | ||
|
||
const CurriculumList = async ({ studyId }: { studyId: string }) => { | ||
const curriculumList = await studyApi.getCurriculumList( | ||
parseInt(studyId, 10) | ||
); | ||
|
||
if (curriculumList?.length === 0) { | ||
return <EmptyCurriculumList />; | ||
} | ||
|
||
return ( | ||
<section aria-label="curriculum-list"> | ||
<Text typo="h2">스터디 커리큘럼</Text> | ||
<Space height={24} /> | ||
{curriculumList?.map((curriculum) => ( | ||
<CurriculumListItem | ||
curriculum={curriculum} | ||
key={`curriculumItem-${curriculum.studyDetailId}`} | ||
/> | ||
))} | ||
</section> | ||
); | ||
}; | ||
|
||
export default CurriculumList; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 0 additions & 25 deletions
25
apps/admin/app/studies/[studyId]/_components/session/SessionList.tsx
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
...dies/detail-info/[studyId]/@modal/(.)detail-Info-check/_hooks/useSubmitStudyDetailInfo.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { createStudyApi } from "apis/study/createStudyApi"; | ||
import { routerPath } from "constants/router/routerPath"; | ||
import { useRouter } from "next/navigation"; | ||
import { useState } from "react"; | ||
import type { CreateStudyDetailInfoApiRequestDto } from "types/dtos/studyDetailInfo"; | ||
|
||
const useSubmitStudyDetailInfo = ( | ||
studyId: number, | ||
studyDetailData: CreateStudyDetailInfoApiRequestDto | ||
) => { | ||
const [isSuccess, setIsSuccess] = useState(false); | ||
const router = useRouter(); | ||
|
||
const handleSubmitDetailInfo = async () => { | ||
const data = await createStudyApi.postStudyDetailInfo( | ||
studyDetailData, | ||
studyId | ||
); | ||
if (data.success) { | ||
setIsSuccess(true); | ||
const timerId = setTimeout(() => { | ||
router.push(`${routerPath.root.href}/${studyId}`); | ||
}, 500); | ||
return () => clearTimeout(timerId); | ||
} else { | ||
setIsSuccess(false); | ||
window.alert("스터디 상세 정보 저장에 실패했어요."); | ||
router.push(`${routerPath.root.href}`); | ||
} | ||
}; | ||
|
||
return { isSuccess, handleSubmitDetailInfo }; | ||
}; | ||
|
||
export default useSubmitStudyDetailInfo; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.