Skip to content

Commit

Permalink
Merge pull request #19 from potato-club/add/modal
Browse files Browse the repository at this point in the history
[#16] Feat Modal
  • Loading branch information
JoGeumJu authored Feb 20, 2023
2 parents fac5575 + f558e92 commit 6d78373
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/components/modal/alert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ export const Alert = ({ content, isOpen, closeModal }: Props) => {
>
<Wrapper isOpen={isOpen} ref={modalRef}>
<Content>{content}</Content>
<Button onClick={closeModal}>닫기</Button>
<Button type="button" onClick={closeModal}>
닫기
</Button>
</Wrapper>
</CSSTransition>
);
Expand Down
17 changes: 14 additions & 3 deletions src/components/modal/modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,19 @@ interface Props {
isOpen: boolean;
closeModal: () => void;
event: () => void;
eventBtnType: "button" | "submit" | "reset";
}
interface StyleProps {
isOpen: boolean;
}

export const Modal = ({ content, isOpen, closeModal, event }: Props) => {
export const Modal = ({
content,
isOpen,
closeModal,
event,
eventBtnType,
}: Props) => {
const modalRef = useRef(null);
return (
<CSSTransition
Expand All @@ -26,8 +33,12 @@ export const Modal = ({ content, isOpen, closeModal, event }: Props) => {
<Content>{content}</Content>
<Buttons>
<Division />
<Button onClick={event}></Button>
<Button onClick={closeModal}>아니요</Button>
<Button type={eventBtnType} onClick={event}>
</Button>
<Button type="button" onClick={closeModal}>
아니요
</Button>
</Buttons>
</Wrapper>
</CSSTransition>
Expand Down

0 comments on commit 6d78373

Please sign in to comment.