-
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
34 changed files
with
230 additions
and
897 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,5 +43,5 @@ const errorPageContentStyle = css({ | |
}); | ||
|
||
const buttonStyle = { | ||
width: 328, | ||
maxWidth: 328, | ||
}; |
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 |
---|---|---|
|
@@ -50,5 +50,5 @@ const notFoundPageContentStyle = css({ | |
}); | ||
|
||
const buttonStyle = { | ||
width: 328, | ||
maxWidth: 328, | ||
}; |
66 changes: 66 additions & 0 deletions
66
apps/admin/app/studies/create-study/@modal/(.)created-study-check/page.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,66 @@ | ||
"use client"; | ||
|
||
import { Flex } from "@styled-system/jsx"; | ||
import { Modal, Space, Text } from "@wow-class/ui"; | ||
import { useModalRoute } from "@wow-class/ui/hooks"; | ||
import { createStudyApi } from "apis/form/createStudyApi"; | ||
import { routerPath } from "constants/router/routerPath"; | ||
import { tags } from "constants/tags"; | ||
import useParseSearchParams from "hooks/useParseSearchParams"; | ||
import Image from "next/image"; | ||
import { useRouter } from "next/navigation"; | ||
import type { CreateStudyApiRequestDto } from "types/dtos/createStudy"; | ||
import { revalidateTagByName } from "utils/revalidateTagByName"; | ||
import Button from "wowds-ui/Button"; | ||
|
||
const CreatedStudyCheckModal = () => { | ||
const { parseToJsonSearchParam } = useParseSearchParams(); | ||
const data = parseToJsonSearchParam<CreateStudyApiRequestDto>("data"); | ||
const router = useRouter(); | ||
const { closeModal } = useModalRoute(); | ||
|
||
const studyName = data.title; | ||
const semester = `${data.academicYear}-${data.semesterType === "FIRST" ? "1" : "2"}`; | ||
|
||
const handleClickSubmitButton = async () => { | ||
const result = await createStudyApi.postCreateStudy(data); | ||
|
||
if (result.success) { | ||
await revalidateTagByName(tags.studyList); | ||
window.alert("스터디 생성에 성공했어요."); | ||
router.push(`${routerPath.root.href}`); | ||
} else { | ||
window.alert("스터디 생성에 실패했어요."); | ||
} | ||
}; | ||
|
||
return ( | ||
<Modal> | ||
<Flex alignItems="center" direction="column" padding="24px" width="100%"> | ||
<Flex alignItems="center" gap="sm" justify="center" marginBottom="2px"> | ||
<Text color="primary" typo="h1"> | ||
{studyName} | ||
</Text> | ||
<ItemSeparator /> | ||
<Text color="primary" typo="h1"> | ||
{semester} | ||
</Text> | ||
</Flex> | ||
<Text typo="h1">새로운 스터디를 개설하시겠어요?</Text> | ||
<Space height={28} /> | ||
<Flex gap="sm" justify="center" width="21rem"> | ||
<Button variant="outline" onClick={closeModal}> | ||
취소 | ||
</Button> | ||
<Button onClick={handleClickSubmitButton}>개설하기</Button> | ||
</Flex> | ||
</Flex> | ||
</Modal> | ||
); | ||
}; | ||
|
||
export default CreatedStudyCheckModal; | ||
|
||
const ItemSeparator = () => ( | ||
<Image alt="item separator" height={6} src="/images/dot.svg" width={6} /> | ||
); |
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,5 @@ | ||
const Default = () => { | ||
return null; | ||
}; | ||
|
||
export default Default; |
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
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
8 changes: 8 additions & 0 deletions
8
apps/admin/app/studies/create-study/created-study-check/page.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,8 @@ | ||
import { routerPath } from "constants/router/routerPath"; | ||
import { redirect } from "next/navigation"; | ||
|
||
const CreatedStudyCheckPage = () => { | ||
return redirect(routerPath.root.href); | ||
}; | ||
|
||
export default CreatedStudyCheckPage; |
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,5 @@ | ||
const Default = () => { | ||
return null; | ||
}; | ||
|
||
export default Default; |
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,16 @@ | ||
const CreateStudyLayout = ({ | ||
children, | ||
modal, | ||
}: Readonly<{ | ||
children: React.ReactNode; | ||
modal: React.ReactNode; | ||
}>) => { | ||
return ( | ||
<main> | ||
{children} | ||
{modal} | ||
</main> | ||
); | ||
}; | ||
|
||
export default CreateStudyLayout; |
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
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
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
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
Oops, something went wrong.