-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: 스터디 종료/삭제 관련 모달 props 타입 정의 #201 * feat: 스터디 삭제 모달 구현 #201 * feat: 스터디 종료 모달 구현 #201 * feat: 스터디 종료, 삭제 버튼 추가 #201 * refact: studyControlPanel 분리 #201 * refact: 큰 따옴표를 표시하는 방식 수정 #201 * refact: 큰 따옴표를 표시하는 방식 수정 #201
- Loading branch information
Showing
6 changed files
with
177 additions
and
42 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { Text } from '@chakra-ui/react'; | ||
|
||
import ConfirmModal from '@/components/Modal/ConfirmModal'; | ||
|
||
import { DeleteStudyModalProps } from '../types'; | ||
|
||
const DeleteStudyModal = ({ studyName, isOpen, setIsOpen }: DeleteStudyModalProps) => { | ||
const handleClickDelete = () => { | ||
// TODO - API 연결 | ||
setIsOpen(false); | ||
}; | ||
|
||
return ( | ||
<ConfirmModal | ||
isOpen={isOpen} | ||
onClose={() => setIsOpen(false)} | ||
title="스터디 삭제" | ||
confirmButtonText="삭제" | ||
onConfirmButtonClick={handleClickDelete} | ||
> | ||
<Text align="center"> | ||
삭제된 스터디는 되돌릴 수 없습니다. | ||
<br /> | ||
{`"${studyName}"을 삭제하시겠습니까?`} | ||
</Text> | ||
</ConfirmModal> | ||
); | ||
}; | ||
|
||
export default DeleteStudyModal; |
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,32 @@ | ||
import { Text } from '@chakra-ui/react'; | ||
|
||
import ConfirmModal from '@/components/Modal/ConfirmModal'; | ||
|
||
import { TerminateStudyModalProps } from '../types'; | ||
|
||
const TerminateStudyModal = ({ studyName, isOpen, setIsOpen }: TerminateStudyModalProps) => { | ||
const handleClickTerminate = () => { | ||
// TODO - API 연결 | ||
setIsOpen(false); | ||
}; | ||
|
||
return ( | ||
<ConfirmModal | ||
isOpen={isOpen} | ||
onClose={() => setIsOpen(false)} | ||
title="스터디 종료" | ||
confirmButtonText="종료" | ||
onConfirmButtonClick={handleClickTerminate} | ||
> | ||
<Text align="center"> | ||
스터디 종료시 수료증이 발급되며 | ||
<br /> | ||
스터디 정보 수정 및 삭제가 불가능합니다. | ||
<br /> | ||
{`"${studyName}"을 종료하시겠습니까?`} | ||
</Text> | ||
</ConfirmModal> | ||
); | ||
}; | ||
|
||
export default TerminateStudyModal; |
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,11 @@ | ||
export interface TerminateStudyModalProps { | ||
studyName: string; | ||
isOpen: boolean; | ||
setIsOpen: React.Dispatch<React.SetStateAction<boolean>>; | ||
} | ||
|
||
export interface DeleteStudyModalProps { | ||
studyName: string; | ||
isOpen: boolean; | ||
setIsOpen: React.Dispatch<React.SetStateAction<boolean>>; | ||
} |
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,40 @@ | ||
import { Button, Flex } from '@chakra-ui/react'; | ||
|
||
import { StudyControlPanelProps } from './types'; | ||
|
||
const StudyControlPanel = ({ terminateModalOpen, deleteModalOpen }: StudyControlPanelProps) => { | ||
return ( | ||
<Flex gap="2" mb="8"> | ||
<Button | ||
w="fit-content" | ||
px="4" | ||
py="1" | ||
color="white" | ||
bg="orange_dark" | ||
shadow="md" | ||
_hover={{ bg: 'orange_dark' }} | ||
aria-label="" | ||
onClick={() => terminateModalOpen(true)} | ||
size="xs" | ||
> | ||
종료 | ||
</Button> | ||
<Button | ||
w="fit-content" | ||
px="4" | ||
py="1" | ||
color="black" | ||
bg="white" | ||
shadow="md" | ||
_hover={{ bg: 'white' }} | ||
aria-label="" | ||
onClick={() => deleteModalOpen(true)} | ||
size="xs" | ||
> | ||
삭제 | ||
</Button> | ||
</Flex> | ||
); | ||
}; | ||
|
||
export default StudyControlPanel; |
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,4 @@ | ||
export interface StudyControlPanelProps { | ||
terminateModalOpen: React.Dispatch<React.SetStateAction<boolean>>; | ||
deleteModalOpen: React.Dispatch<React.SetStateAction<boolean>>; | ||
} |