Skip to content

Commit

Permalink
feat: modal 버튼 함수 프롭 전달
Browse files Browse the repository at this point in the history
  • Loading branch information
imeureka committed Jan 11, 2024
1 parent b47fc8b commit 6495d45
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/components/common/Modal/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,18 @@ import BtnMedium from '../Button/Cta/medium/BtnMedium';

interface ModalProps {
children: React.ReactNode;
onConfirmClick?: () => void; // 클릭 이벤트 함수를 받을 수 있는 프롭 추가
}

const Modal: React.FC<ModalProps> = ({ children }) => {
const Modal: React.FC<ModalProps> = ({ children, onConfirmClick }) => {
return (
<>
<S.Overlay />
<S.ModalWrapper>
<S.ModalContent>{children}</S.ModalContent>
<BtnMedium customStyle={{ width: '21.3rem' }}>확인</BtnMedium>
<BtnMedium customStyle={{ width: '21.3rem' }} onClick={onConfirmClick}>
확인
</BtnMedium>
</S.ModalWrapper>
</>
);
Expand Down

0 comments on commit 6495d45

Please sign in to comment.