-
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
1 parent
2951b03
commit b25b896
Showing
3 changed files
with
45 additions
and
3 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,37 @@ | ||
import { useNavigate } from 'react-router-dom'; | ||
|
||
import { Modal, Button } from '@/components'; | ||
import { StateAndAction } from '@/types/state'; | ||
|
||
type ContestProblemCreateModal<T extends React.ElementType> = Component<T> & | ||
StateAndAction<boolean, 'showModal'>; | ||
|
||
export function ContestProblemCreateModal({ | ||
showModal, | ||
setShowModal, | ||
}: ContestProblemCreateModal<'div'>) { | ||
const navigate = useNavigate(); | ||
|
||
const handleCreateButtonClick = () => { | ||
navigate('create'); | ||
}; | ||
|
||
const handleGetButtonClick = () => { | ||
navigate('edit'); | ||
}; | ||
|
||
return ( | ||
<Modal open={showModal}> | ||
<Modal.Header>문제 만들기</Modal.Header> | ||
<Modal.Body className="w-[300px] flex flex-col gap-2"> | ||
<Button onClick={handleCreateButtonClick}>새로운 문제 만들기</Button> | ||
<Button onClick={handleGetButtonClick}>기존 문제 가져오기</Button> | ||
</Modal.Body> | ||
<Modal.Footer className="gap-2"> | ||
<Button color="error" type="button" onClick={() => setShowModal(false)}> | ||
닫기 | ||
</Button> | ||
</Modal.Footer> | ||
</Modal> | ||
); | ||
} |
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